window: Be more careful when looking for focus

When passing focus up to a parent, make sure the
newly chosen focus widget actually accepts the focus.
This commit is contained in:
Matthias Clasen 2020-10-08 20:32:39 -04:00
parent eb647299d4
commit 6a0704aeb4

View File

@ -5242,8 +5242,8 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
{
if (_gtk_widget_get_visible (parent))
{
gtk_window_set_focus (window, parent);
break;
if (gtk_widget_grab_focus (parent))
break;
}
parent = gtk_widget_get_parent (parent);