window: Some protection against nested set_focus() calls

Since set_focus() can triger events, have a check to make
sure state is still valid before firing is-focus signal.

https://bugzilla.gnome.org/show_bug.cgi?id=706152
This commit is contained in:
Stef Walter 2013-08-16 21:19:15 +02:00
parent 9896b9960d
commit 6a837c668a

View File

@ -7514,7 +7514,11 @@ gtk_window_real_set_focus (GtkWindow *window,
if (priv->has_focus)
do_focus_change (priv->focus_widget, TRUE);
g_object_notify (G_OBJECT (priv->focus_widget), "is-focus");
/* It's possible for do_focus_change() above to have callbacks
* that clear priv->focus_widget here.
*/
if (priv->focus_widget)
g_object_notify (G_OBJECT (priv->focus_widget), "is-focus");
}
/* If the default widget changed, a redraw will have been queued