[gtk/focus-chain-test: 1/2] window: Fix focus wraparound



commit 31066a697b42ad8ef6f4d28c069dfa74072b5f32
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 11 13:14:25 2019 +0000

    window: Fix focus wraparound
    
    If tab focus falls off the end, and we have an empty headerbar,
    we end up with window->focus == NULL. Don't let that happen

 gtk/gtkwindow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1450873a45..7d9a8f803c 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6305,7 +6305,7 @@ gtk_window_focus (GtkWidget        *widget,
   if (old_focus_child)
     {
       if (gtk_widget_child_focus (old_focus_child, direction))
-       return TRUE;
+        return TRUE;
     }
 
   if (priv->focus_widget)
@@ -6348,7 +6348,9 @@ gtk_window_focus (GtkWidget        *widget,
                priv->title_box != child &&
                gtk_widget_child_focus (priv->title_box, direction))
         return TRUE;
-
+      else if (priv->title_box == child &&
+               gtk_widget_child_focus (gtk_bin_get_child (bin), direction))
+        return TRUE;
     }
 
   return FALSE;


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