diff options
author | George Mocanu <mocanu.geo98@gmail.com> | 2018-06-03 15:31:12 +0200 |
---|---|---|
committer | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2018-07-18 01:40:33 +0200 |
commit | 455367f3b7927b12582a0759d616e34f969d4052 (patch) | |
tree | b8e4527da1e5353fe3cc594aea1aff208eee3fbd | |
parent | 93366233069acdb4c709a2796e005a0e03fa24c9 (diff) | |
download | nautilus-455367f3b7927b12582a0759d616e34f969d4052.tar.gz |
list-view: Fix middle-click behaviour
Currently, for double-click mode, middle-clicking a folder in
List View fails to open a new tab, but only highlights the
selection instead. Middle-clicking the folder again opens it
in a new tab.
For double-click mode, middle-clicking a folder should open it
in a new tab. Also, middle-clicking a file should open it.
This patch fixes this behaviour.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/453
-rw-r--r-- | src/nautilus-list-view.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index 9c168f97e..2a0dfcdbf 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c @@ -592,16 +592,9 @@ button_press_callback (GtkWidget *widget, nautilus_file_unref (file); } } - else + else if ((event->button == GDK_BUTTON_PRIMARY || event->button == GDK_BUTTON_SECONDARY)) { - if ((event->button == 1 || event->button == 3)) - { - activate_selected_items (view); - } - else if (event->button == 2) - { - activate_selected_items_alternate (view, NULL, TRUE); - } + activate_selected_items (view); } } else @@ -695,6 +688,19 @@ button_press_callback (GtkWidget *widget, { do_popup_menu (widget, view, event); } + + /* Don't open a new tab if we are in single click mode (this would open 2 tabs), + * or if CTRL or SHIFT is pressed. + */ + if (event->button == GDK_BUTTON_MIDDLE && + get_click_policy () != NAUTILUS_CLICK_POLICY_SINGLE && + !button_event_modifies_selection (event)) + { + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_path (selection, path); + + activate_selected_items_alternate (view, NULL, TRUE); + } } gtk_tree_path_free (path); |