Commit a01fe140 authored by Carlos Garnacho's avatar Carlos Garnacho

popover: Avoid hiding modal popovers if another popover is taking focus

Due to popover modality itself, there's quite high chances the popover
stealing focus has been triggered from within, so stay friendly to it.
Hiding the popover here will only hide the grabbing popover too if this
happens.

https://bugzilla.gnome.org/show_bug.cgi?id=750741
parent a0ff35f0
......@@ -413,7 +413,14 @@ window_set_focus (GtkWindow *window,
if (priv->modal && widget &&
gtk_widget_is_drawable (GTK_WIDGET (popover)) &&
!gtk_widget_is_ancestor (widget, GTK_WIDGET (popover)))
gtk_widget_hide (GTK_WIDGET (popover));
{
GtkWidget *grab_widget;
grab_widget = gtk_grab_get_current ();
if (!grab_widget || !GTK_IS_POPOVER (grab_widget))
gtk_widget_hide (GTK_WIDGET (popover));
}
}
static void
......@@ -1746,7 +1753,14 @@ _gtk_popover_parent_grab_notify (GtkWidget *widget,
if (priv->modal &&
gtk_widget_is_visible (GTK_WIDGET (popover)) &&
!gtk_widget_has_grab (GTK_WIDGET (popover)))
gtk_widget_hide (GTK_WIDGET (popover));
{
GtkWidget *grab_widget;
grab_widget = gtk_grab_get_current ();
if (!grab_widget || !GTK_IS_POPOVER (grab_widget))
gtk_widget_hide (GTK_WIDGET (popover));
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment