diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 5a4aca4b..7848e868 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -713,15 +713,15 @@ thunar_tree_view_button_press_event (GtkWidget *widget, /* reset the pressed button state */ view->pressed_button = -1; - if (event->button == 2) + if (event->button == 2 || event->button == 3) { - /* completely ignore double middle clicks */ + /* completely ignore double middle/right clicks */ if (event->type == GDK_2BUTTON_PRESS) return TRUE; /* remember the current selection as we want to restore it later */ gtk_tree_path_free (view->select_path); - gtk_tree_view_get_cursor(GTK_TREE_VIEW (view), &(view->select_path), NULL); + gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &(view->select_path), NULL); } /* let the widget process the event first (handles focussing and scrolling) */ @@ -789,6 +789,17 @@ thunar_tree_view_button_press_event (GtkWidget *widget, gtk_tree_path_free (path); } + if (event->button == 3) + { + if (view->select_path != NULL) + { + /* restore the previous selection */ + gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), view->select_path, NULL, FALSE); + gtk_tree_path_free (view->select_path); + view->select_path = NULL; + } + } + return result; }