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);