[gtk+/gtk-3-22] ScrolledWindow: Dodge possible surplus disconnects
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] ScrolledWindow: Dodge possible surplus disconnects
- Date: Fri, 1 Sep 2017 15:36:41 +0000 (UTC)
commit 423cd8e73e63dc27a2749a3b83613edbd35df767
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 3058d3b..25e5d1c 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -2258,7 +2258,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_range_set_adjustment (GTK_RANGE (priv->hscrollbar), hadjustment);
@@ -2329,7 +2334,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_range_set_adjustment (GTK_RANGE (priv->vscrollbar), vadjustment);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]