diff options
author | Debarshi Ray <debarshir@gnome.org> | 2015-05-06 16:53:43 +0200 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2015-05-06 22:31:10 +0200 |
commit | 26b03332a4cd6a08d85a81097762bee4eb21689d (patch) | |
tree | 983909afd28aef1ea226cdcecbfd8497855599eb /gtk/gtkstackswitcher.c | |
parent | 6a51ac59f05b01d2fd1def67a6df589de4b423a5 (diff) | |
download | gtk+-26b03332a4cd6a08d85a81097762bee4eb21689d.tar.gz |
GtkStackSwitcher: Don't emit notify::visible-child when setting a stack
Synchronizing the visible child with the switcher's toggle buttons can
lead to GtkButton::clicked being emitted twice. Once for the button
that was active before, and once for the button that we just activated.
This leads to notify::visible-child being called twice and one of
them is with the wrong child.
Let's deal with this in the same way we handle the visible child
changing underneath us.
https://bugzilla.gnome.org/show_bug.cgi?id=749021
Diffstat (limited to 'gtk/gtkstackswitcher.c')
-rw-r--r-- | gtk/gtkstackswitcher.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c index 42e41bbd75..f2932a9a04 100644 --- a/gtk/gtkstackswitcher.c +++ b/gtk/gtkstackswitcher.c @@ -300,7 +300,9 @@ populate_switcher (GtkStackSwitcher *self) if (widget) { button = g_hash_table_lookup (priv->buttons, widget); + priv->in_child_changed = TRUE; gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + priv->in_child_changed = FALSE; } } |