[gtk+] ScrolledWindow: Dodge possible surplus disconnects
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] ScrolledWindow: Dodge possible surplus disconnects
- Date: Fri, 1 Sep 2017 15:36:38 +0000 (UTC)
commit 021e0d5e3dd4f61ed4c8a1f319fe1034482ec3b7
Author: Daniel Boles <dboles src gnome org>
Date: Fri Sep 1 16:03:36 2017 +0100
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.
gtk/gtkscrolledwindow.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 99245c7..4a7e64e 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]