GtkSwitch: fix a reentry issue

The introduction of state broke some users which relied on
being able to set active in a notify::active handler.

https://bugzilla.gnome.org/show_bug.cgi?id=751754
This commit is contained in:
Matthias Clasen 2015-07-01 18:02:57 -07:00
parent 862e0dab03
commit 1be338fd44

View File

@ -1092,10 +1092,10 @@ gtk_switch_set_active (GtkSwitch *sw,
else
priv->handle_pos = 0.0;
g_object_notify_by_pspec (G_OBJECT (sw), switch_props[PROP_ACTIVE]);
g_signal_emit (sw, signals[STATE_SET], 0, is_active, &handled);
g_object_notify_by_pspec (G_OBJECT (sw), switch_props[PROP_ACTIVE]);
accessible = gtk_widget_get_accessible (GTK_WIDGET (sw));
atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, priv->is_active);