GtkPopover: avoid a critical

focus_widget can be NULL, as pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=723181#c7
This commit is contained in:
Matthias Clasen
2014-01-30 08:11:41 -05:00
parent c985c57818
commit 4e066a750a

View File

@ -246,7 +246,9 @@ gtk_popover_apply_modality (GtkPopover *popover,
GtkWidget *prev_focus;
prev_focus = gtk_window_get_focus (priv->window);
priv->prev_focus_widget = g_object_ref (prev_focus);
priv->prev_focus_widget = prev_focus;
if (priv->prev_focus_widget)
g_object_ref (prev_focus);
gtk_grab_add (GTK_WIDGET (popover));
gtk_widget_grab_focus (GTK_WIDGET (popover));
}