[nautilus/gnome-3-26] window: Allow dead_tilde key to trigger location entry



commit 04ca0cd31285d82ea07677c6e42d79e1dd3bccbd
Author: António Fernandes <antoniof gnome org>
Date:   Sun May 6 20:45:11 2018 +0200

    window: Allow dead_tilde key to trigger location entry
    
    The standalone "~" key ("asciitilde") works as a convenient shortcut
    to type home-relative paths into the location entry.
    
    However, some keyboard layouts don't have an standalone "~" key but
    rather a "dead tilde" key. This makes the existing shortcut unavaliable
    for some keyboard layouts.
    
    This is surprising for most people, because they have a tilde key and
    the Keyboard Shortcuts window advertises a shortcut for the tilde key.
    
    So, add the dead tilde key as an alternative shortcut.
    
    Note: Searching for tilded characters or the tilde character itself
    is still possible by revealing the search entry is explicitly.
    
    Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/372

 src/nautilus-window.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 9eaae353c..0bff4e083 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2284,6 +2284,12 @@ nautilus_window_initialize_actions (NautilusWindow *window)
         "<ctrl>r",
         NULL
     };
+    const gchar *prompt_home_location_accels[] =
+    {
+        "asciitilde",
+        "dead_tilde",
+        NULL
+    };
 
     g_action_map_add_action_entries (G_ACTION_MAP (window),
                                      win_entries, G_N_ELEMENTS (win_entries),
@@ -2310,7 +2316,8 @@ nautilus_window_initialize_actions (NautilusWindow *window)
     nautilus_application_set_accelerator (app, "win.tab-move-left", "<shift><control>Page_Up");
     nautilus_application_set_accelerator (app, "win.tab-move-right", "<shift><control>Page_Down");
     nautilus_application_set_accelerator (app, "win.prompt-root-location", "slash");
-    nautilus_application_set_accelerator (app, "win.prompt-home-location", "asciitilde");
+    /* Support keyboard layouts which have a dead tilde key but not a tilde key. */
+    nautilus_application_set_accelerators (app, "win.prompt-home-location", prompt_home_location_accels);
     nautilus_application_set_accelerator (app, "win.view-menu", "F10");
     nautilus_application_set_accelerator (app, "win.restore-tab", "<shift><control>t");
 


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