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



commit ff776c252121710a73602d8affd3ba48af31dee6
Author: António Fernandes <antoniof gnome org>
Date:   Sun May 6 19:45:11 2018 +0100

    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
    
    
    (cherry picked from commit ab16292e698cbcfdbc2cd175cdeaac4a8a898a69)

 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 1f8d5208e..41c4623be 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2335,6 +2335,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),
@@ -2361,7 +2367,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]