summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-08 20:32:39 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-09 07:43:25 -0400
commit6a0704aeb4edb0d43010270348c8de1d27e4453a (patch)
tree403dec7b3e5a478ba44805b85ba9ae17aee9b475
parenteb647299d465599c99fd3845f4d0a5258139b842 (diff)
downloadgtk+-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.c4
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);