Move focus to the parent if a popover is dismissed

This is better than just dropping focus altogether,
and is expected behavior in most cases.
This commit is contained in:
Matthias Clasen 2020-04-09 12:03:23 -04:00
parent 35ba24d2e8
commit 72ae6daa1e

View File

@ -5740,7 +5740,16 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
child = _gtk_widget_get_parent (child);
if (child == widget)
gtk_window_set_focus (GTK_WINDOW (window), NULL);
{
GtkWidget *new_focus;
if (GTK_IS_NATIVE (widget))
new_focus = gtk_widget_get_parent (widget);
else
new_focus = NULL;
gtk_window_set_focus (GTK_WINDOW (window), new_focus);
}
}
child = priv->default_widget;