Avoid a critical

gtk_window_get_focus can return NULL, deal with it.

https://bugzilla.gnome.org/show_bug.cgi?id=740812
This commit is contained in:
Matthias Clasen 2014-11-27 18:22:52 -05:00
parent 8753ef6129
commit e26fddc544

View File

@ -311,7 +311,7 @@ window_focus_in (GtkWidget *widget,
focus = gtk_window_get_focus (GTK_WINDOW (widget));
if (!gtk_widget_is_ancestor (focus, GTK_WIDGET (popover)))
if (focus == NULL || !gtk_widget_is_ancestor (focus, GTK_WIDGET (popover)))
gtk_widget_grab_focus (GTK_WIDGET (popover));
if (priv->grab_notify_blocked)