[gtk/matthiasc/for-master: 8/10] window: Be more careful when looking for focus




commit 6a0704aeb4edb0d43010270348c8de1d27e4453a
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 8 20:32:39 2020 -0400

    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.

 gtk/gtkwindow.c | 4 ++--
 1 file 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]