diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-08 20:32:39 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-09 07:43:25 -0400 |
commit | 6a0704aeb4edb0d43010270348c8de1d27e4453a (patch) | |
tree | 403dec7b3e5a478ba44805b85ba9ae17aee9b475 | |
parent | eb647299d465599c99fd3845f4d0a5258139b842 (diff) | |
download | gtk+-6a0704aeb4edb0d43010270348c8de1d27e4453a.tar.gz |
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.
-rw-r--r-- | gtk/gtkwindow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index c5c69e2b33..a6f7f37912 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -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); |