summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-list-view.c
diff options
context:
space:
mode:
authorMartin Matuska <[email protected]>2016-08-05 14:58:37 +0200
committerraveit65 <[email protected]>2016-10-16 11:50:33 +0200
commit625a06c0a0781025693a6299b721b6bc7a065c1a (patch)
tree1252ca50706bd304cd5632d9d96e227557e6ea42 /src/file-manager/fm-list-view.c
parentdffb0850e530855fe67a4a6e8768c4b9ecf17a62 (diff)
downloadcaja-625a06c0a0781025693a6299b721b6bc7a065c1a.tar.bz2
caja-625a06c0a0781025693a6299b721b6bc7a065c1a.tar.xz
support back and forward mouse buttons to navigate
Fixes https://github.com/mate-desktop/caja/issues/78 Co-Authored-By: Oliver Joos <[email protected]> Co-Authored-By: Nelson Benitez Leon <[email protected]>
Diffstat (limited to 'src/file-manager/fm-list-view.c')
-rw-r--r--src/file-manager/fm-list-view.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 46f6c143..999254d0 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -665,6 +665,9 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
FMListView *view;
GtkTreeView *tree_view;
GtkTreePath *path;
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ GtkWidget *caja_window;
+#endif
gboolean call_parent;
GtkTreeSelection *selection;
GtkWidgetClass *tree_view_class;
@@ -680,6 +683,14 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
tree_view_class = GTK_WIDGET_GET_CLASS (tree_view);
selection = gtk_tree_view_get_selection (tree_view);
+#if GTK_CHECK_VERSION(3, 0, 0)
+ /* Don't handle extra mouse buttons here */
+ if (event->button > 5)
+ {
+ return FALSE;
+ }
+#endif
+
if (event->window != gtk_tree_view_get_bin_window (tree_view))
{
return FALSE;
@@ -849,6 +860,13 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
}
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ if (event->button > 5) {
+ caja_window = GTK_WIDGET (fm_directory_view_get_caja_window (FM_DIRECTORY_VIEW (view)));
+ call_parent = !caja_navigation_window_button_press_event (caja_window, event);
+ }
+#endif
+
if (call_parent)
{
tree_view_class->button_press_event (widget, event);
@@ -887,10 +905,22 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
view->details->double_click_path[1] = view->details->double_click_path[0];
view->details->double_click_path[0] = NULL;
}
+#if GTK_CHECK_VERSION(3, 0, 0)
/* Deselect if people click outside any row. It's OK to
let default code run; it won't reselect anything. */
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (tree_view));
tree_view_class->button_press_event (widget, event);
+#else
+ if (event->button > 5) {
+ caja_window = GTK_WIDGET (fm_directory_view_get_caja_window (FM_DIRECTORY_VIEW (view)));
+ call_parent = !caja_navigation_window_button_press_event (caja_window, event);
+ } else {
+ /* Deselect if people click outside any row. It's OK to
+ let default code run; it won't reselect anything. */
+ gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (tree_view));
+ tree_view_class->button_press_event (widget, event);
+ }
+#endif
if (event->button == 3)
{