summaryrefslogtreecommitdiffstats
path: root/main/nautilus/011-keyboard-navigation.patch
blob: 34425ac2ac361690037643eed62aee6d179d8f54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

++ nautilus-2.32.2.1/debian/patches/97_keyboard_nav_in_sidebar.patch

From: Omer Akram <om26er@ubuntu.com>
Author: Stefano Teso <stefano.teso@gmail.com>
Subject: Places-sidebar: allow keyboard navigation with Enter/Space.
Origin: http://git.gnome.org/browse/nautilus/commit/?id=fd03c910a73ba18459e68baaf15e8dd295acd5c1
Bug: https://bugs.gnome.org/637768
Bug-Ubuntu: https://launchpad.net/bugs/649993

--- a//src/nautilus-places-sidebar.c	2010-12-28 20:54:38.000000000 +0500
+++ b//src/nautilus-places-sidebar.c	2011-02-28 12:15:11.096777018 +0500
@@ -2198,6 +2198,30 @@
 
   modifiers = gtk_accelerator_get_default_mod_mask ();
 
+  if ((event->keyval == GDK_KEY_Return ||
+       event->keyval == GDK_KEY_KP_Enter ||
+       event->keyval == GDK_KEY_ISO_Enter ||
+       event->keyval == GDK_KEY_space)) {
+
+      GtkTreeModel *model;
+      GtkTreePath *path;
+      NautilusWindowOpenFlags flags = 0;
+
+      if ((event->state & modifiers) == GDK_SHIFT_MASK) {
+          flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+      } else if ((event->state & modifiers) == GDK_CONTROL_MASK) {
+          flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+      }
+
+      model = gtk_tree_view_get_model (sidebar->tree_view);
+      gtk_tree_view_get_cursor (sidebar->tree_view, &path, NULL);
+
+      open_selected_bookmark (sidebar, model, path, flags);
+
+      gtk_tree_path_free (path);
+      return TRUE;
+  }
+
   if (event->keyval == GDK_Down &&
       (event->state & modifiers) == GDK_MOD1_MASK) {
       return eject_or_unmount_selection (sidebar);