From 936d9e646c224c076ae3573e6a09760eb7c24b10 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 23 Feb 2003 14:11:04 +0000 Subject: [PATCH] r2450: Bugfix: A double-click which starts on one file and ends on another is now ignored (reported by Michael Adams). --- ROX-Filer/Help/Changes | 2 ++ ROX-Filer/src/bind.c | 4 ++-- ROX-Filer/src/bind.h | 2 +- ROX-Filer/src/filer.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 994ece97..d5081ae2 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -4,6 +4,8 @@ 23-Feb-2003 ~~~~~~~~~~~ +Bugfix: A double-click which starts on one file and ends on another is now + ignored (reported by Michael Adams). Bugfix: Test for valid sort-type in SOAP call was reserved, so you couldn't set the sort type (reported by Damjan Bole). Bugfix: Using a SOAP call to open a non-existant directory made the filer diff --git a/ROX-Filer/src/bind.c b/ROX-Filer/src/bind.c index 970bf98e..ad4a73df 100644 --- a/ROX-Filer/src/bind.c +++ b/ROX-Filer/src/bind.c @@ -30,9 +30,9 @@ #include "options.h" #include "bind.h" -Option o_new_button_1; +Option o_new_button_1, o_single_click; static Option o_menu_button_2; -static Option o_single_click, o_single_pinboard; +static Option o_single_pinboard; /**************************************************************** * EXTERNAL INTERFACE * diff --git a/ROX-Filer/src/bind.h b/ROX-Filer/src/bind.h index 0e541dd7..96675c05 100644 --- a/ROX-Filer/src/bind.h +++ b/ROX-Filer/src/bind.h @@ -8,7 +8,7 @@ #include -extern Option o_new_button_1; +extern Option o_new_button_1, o_single_click; typedef enum { BIND_DIRECTORY, diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c index 9200601b..e03fe08e 100644 --- a/ROX-Filer/src/filer.c +++ b/ROX-Filer/src/filer.c @@ -2057,6 +2057,36 @@ void filer_perform_action(FilerWindow *filer_window, GdkEventButton *event) return; } + if (!o_single_click.int_value) + { + /* Make sure both parts of a double-click fall on + * the same file. + */ + static guchar *first_click = NULL; + static guchar *second_click = NULL; + + if (event->type == GDK_BUTTON_PRESS) + { + g_free(first_click); + first_click = second_click; + + if (item) + second_click = g_strdup(item->leafname); + else + second_click = NULL; + } + + if (event->type == GDK_2BUTTON_PRESS) + { + if (first_click && second_click && + strcmp(first_click, second_click) != 0) + return; + if ((first_click || second_click) && + !(first_click && second_click)) + return; + } + } + action = bind_lookup_bev( item ? BIND_DIRECTORY_ICON : BIND_DIRECTORY, event); -- 2.11.4.GIT