[gtk/gtk-4-6: 1/2] Propagate key events when the location entry is focused




commit 73afd4976acdd69fc93091d8e0a3cfd82d325013
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Fri Apr 29 13:19:01 2022 +0200

    Propagate key events when the location entry is focused
    
    Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4880

 gtk/gtkfilechooserwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 16a4f2c1a7..159f4931e0 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -7763,6 +7763,14 @@ captured_key (GtkEventControllerKey *controller,
   if (keyval == GDK_KEY_slash)
     return GDK_EVENT_PROPAGATE;
 
+  if (impl->location_entry)
+    {
+      GtkWidget *focus = gtk_root_get_focus (gtk_widget_get_root (GTK_WIDGET (impl)));
+
+      if (focus && gtk_widget_is_ancestor (focus, impl->location_entry))
+        return GDK_EVENT_PROPAGATE;
+    }
+
   handled = gtk_event_controller_key_forward (controller, GTK_WIDGET (impl->search_entry));
   if (handled == GDK_EVENT_STOP)
     operation_mode_set (impl, OPERATION_MODE_SEARCH);


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