ScrolledWindow: Dodge possible surplus disconnects

In case the outgoing Adjustment for whatever reason has other handlers
referring to this SW, be sure to avoid disconnecting any but our own.
This commit is contained in:
Daniel Boles 2017-09-01 16:03:36 +01:00
parent 9a6adcbce4
commit 021e0d5e3d

View File

@ -2019,7 +2019,12 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
if (old_adjustment == hadjustment)
return;
g_signal_handlers_disconnect_by_data (old_adjustment, scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_changed,
scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_value_changed,
scrolled_window);
gtk_adjustment_enable_animation (old_adjustment, NULL, 0);
gtk_scrollbar_set_adjustment (GTK_SCROLLBAR (priv->hscrollbar), hadjustment);
@ -2089,7 +2094,12 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
if (old_adjustment == vadjustment)
return;
g_signal_handlers_disconnect_by_data (old_adjustment, scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_changed,
scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_value_changed,
scrolled_window);
gtk_adjustment_enable_animation (old_adjustment, NULL, 0);
gtk_scrollbar_set_adjustment (GTK_SCROLLBAR (priv->vscrollbar), vadjustment);