GtkSwitch: fix a reentry issue
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 01:02:57 +0000 (18:02 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 01:04:56 +0000 (18:04 -0700)
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

gtk/gtkswitch.c

index a2b10e16fbb8028f2a663c8a268a2455fe171fb3..3a2f8e9b9b712e4f2c271ba469cee21c851ac4bf 100644 (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);