[gtk/gtk4_filechooser_fix_keybindings] Fix open location entry when pressing '~' or '.'




commit b91474616b7411488c9299ca69fca3143b2dc116
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Sun Aug 21 15:02:38 2022 -0400

    Fix open location entry when pressing '~' or '.'
    
    Recent changes in GTK default input method
    makes ~ char to start as dead key, that's
    why filechooser stopped detecting it for the
    keybinding to open location entry.
    
    Filechooser also installs keybinding to open
    location entry on period (.) character, that
    was failing too, so we also fixed that.
    
    Fixes #4911

 gtk/gtkfilechooserwidget.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index a2310f35d8..f56c1b2188 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -7618,6 +7618,10 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
                                 GDK_KEY_asciitilde, 0,
                                 trigger_location_entry,
                                 "s", "~");
+  gtk_widget_class_add_binding (widget_class,
+                                GDK_KEY_dead_tilde, 0,
+                                trigger_location_entry,
+                                "s", "~");
 
   for (i = 0; i < G_N_ELEMENTS (quick_bookmark_keyvals); i++)
     gtk_widget_class_add_binding_signal (widget_class,
@@ -7729,7 +7733,7 @@ captured_key (GtkEventControllerKey *controller,
        impl->location_mode == LOCATION_MODE_FILENAME_ENTRY))
     return GDK_EVENT_PROPAGATE;
 
-  if (keyval == GDK_KEY_slash)
+  if (keyval == GDK_KEY_slash || keyval == GDK_KEY_asciitilde || keyval == GDK_KEY_dead_tilde || keyval == 
GDK_KEY_period)
     return GDK_EVENT_PROPAGATE;
 
   handled = gtk_event_controller_key_forward (controller, GTK_WIDGET (impl->search_entry));


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