forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
a0ff35f032
commit
a01fe14056
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user