[gnome-builder/wip/gtk4-port] libide/gui: clear focus when clicking on status page



commit 2709a23162f8bd525650fb01acfd420772a85ef2
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 10 15:27:16 2022 -0700

    libide/gui: clear focus when clicking on status page
    
    Instead of moving focus which ends up sort of weird, just clear the focus
    for the workspace.

 src/libide/gui/ide-frame.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-frame.c b/src/libide/gui/ide-frame.c
index ac82f25be..48ea1950d 100644
--- a/src/libide/gui/ide-frame.c
+++ b/src/libide/gui/ide-frame.c
@@ -178,10 +178,13 @@ status_page_pressed_cb (IdeFrame        *self,
                         int              n_press,
                         GtkGestureClick *click)
 {
+  GtkRoot *root;
+
   g_assert (IDE_IS_FRAME (self));
   g_assert (GTK_IS_GESTURE_CLICK (click));
 
-  gtk_widget_child_focus (GTK_WIDGET (self), GTK_DIR_TAB_FORWARD);
+  root = gtk_widget_get_root (GTK_WIDGET (self));
+  gtk_root_set_focus (root, NULL);
 }
 
 static void


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