[nautilus/wip/antoniof/experimental-gtk4-build: 47/52] HACK for search entry event forward




commit d733e3cd878c11cc47b047e2f75bb515be80118b
Author: António Fernandes <antoniof gnome org>
Date:   Thu Dec 23 17:35:23 2021 +0000

    HACK for search entry event forward

 src/nautilus-query-editor.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index 727240a7c..ef15f11cf 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -804,6 +804,7 @@ nautilus_query_editor_handle_event (NautilusQueryEditor   *self,
                                     guint                  keyval,
                                     GdkModifierType        state)
 {
+    GtkWidget *text;
     g_return_val_if_fail (NAUTILUS_IS_QUERY_EDITOR (self), GDK_EVENT_PROPAGATE);
     g_return_val_if_fail (controller != NULL, GDK_EVENT_PROPAGATE);
 
@@ -815,5 +816,19 @@ nautilus_query_editor_handle_event (NautilusQueryEditor   *self,
         return GDK_EVENT_PROPAGATE;
     }
 
-    return gtk_event_controller_key_forward (controller, GTK_WIDGET (self->entry));
+    text = gtk_widget_get_first_child (GTK_WIDGET (self->entry));
+    while (text != NULL)
+    {
+        if (GTK_IS_TEXT (text))
+        {
+            break;
+        }
+        text = gtk_widget_get_next_sibling (text);
+    }
+
+    if (text == NULL)
+    {
+        return FALSE;
+    }
+    return gtk_event_controller_key_forward (controller, text);
 }


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