popover: Do not hide the popover if the focus widget is just unset

The focus widget might be unset, just to be set again on a widget inside
the popover. Have the popover wait till the focus is actually moved outside
before dismissing.
This commit is contained in:
Carlos Garnacho 2014-05-19 13:41:34 +02:00
parent c665564374
commit e2cd59b731

View File

@ -341,9 +341,9 @@ window_set_focus (GtkWindow *window,
{
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
if (priv->modal &&
if (priv->modal && widget &&
gtk_widget_is_drawable (GTK_WIDGET (popover)) &&
(!widget || !gtk_widget_is_ancestor (widget, GTK_WIDGET (popover))))
!gtk_widget_is_ancestor (widget, GTK_WIDGET (popover)))
gtk_widget_hide (GTK_WIDGET (popover));
}