aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2001-08-13 09:27:43 +0000
committerGerd Moellmann <[email protected]>2001-08-13 09:27:43 +0000
commitc5cf21093ae4ee11b4385fb9d69c9cfb077e5c42 (patch)
tree5f7f814045cc2026a1cee1b31e04c6b26a2af095 /src/keyboard.c
parentd6f207b78d970d968bd5505873cf197161a26d25 (diff)
(make_lispy_event): Interpret double_click_fuzz
in units of 1/8 character on non window-system frames. (syms_of_keyboard) <double-click-fuzz>: Doc fix.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c49
1 files changed, 34 insertions, 15 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 5445761237..b15c213912 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4690,6 +4690,7 @@ make_lispy_event (event)
Lisp_Object position;
Lisp_Object *start_pos_ptr;
Lisp_Object start_pos;
+ Lisp_Object window;
position = Qnil;
@@ -4697,8 +4698,7 @@ make_lispy_event (event)
if (event->kind == mouse_click)
{
int part;
- FRAME_PTR f = XFRAME (event->frame_or_window);
- Lisp_Object window;
+ struct frame *f = XFRAME (event->frame_or_window);
Lisp_Object posn;
Lisp_Object string_info = Qnil;
int row, column;
@@ -4836,7 +4836,6 @@ make_lispy_event (event)
else
{
/* It's a scrollbar click. */
- Lisp_Object window;
Lisp_Object portion_whole;
Lisp_Object part;
@@ -4864,16 +4863,34 @@ make_lispy_event (event)
start_pos = *start_pos_ptr;
*start_pos_ptr = Qnil;
- is_double = (button == last_mouse_button
- && (abs (XINT (event->x) - last_mouse_x)
- <= double_click_fuzz)
- && (abs (XINT (event->y) - last_mouse_y)
- <= double_click_fuzz)
- && button_down_time != 0
- && (EQ (Vdouble_click_time, Qt)
- || (INTEGERP (Vdouble_click_time)
- && ((int)(event->timestamp - button_down_time)
- < XINT (Vdouble_click_time)))));
+ {
+ /* On window-system frames, use the value of
+ double-click-fuzz as is. On other frames, interpret it
+ as a multiple of 1/8 characters. */
+ struct frame *f;
+ int fuzz;
+
+ if (WINDOWP (event->frame_or_window))
+ f = XFRAME (XWINDOW (event->frame_or_window)->frame);
+ else if (FRAMEP (event->frame_or_window))
+ f = XFRAME (event->frame_or_window);
+ else
+ abort ();
+
+ if (FRAME_WINDOW_P (f))
+ fuzz = double_click_fuzz;
+ else
+ fuzz = double_click_fuzz / 8;
+
+ is_double = (button == last_mouse_button
+ && (abs (XINT (event->x) - last_mouse_x) <= fuzz)
+ && (abs (XINT (event->y) - last_mouse_y) <= fuzz)
+ && button_down_time != 0
+ && (EQ (Vdouble_click_time, Qt)
+ || (INTEGERP (Vdouble_click_time)
+ && ((int)(event->timestamp - button_down_time)
+ < XINT (Vdouble_click_time)))));
+ }
last_mouse_button = button;
last_mouse_x = XINT (event->x);
@@ -10541,8 +10558,10 @@ by position only.");
DEFVAR_INT ("double-click-fuzz", &double_click_fuzz,
"*Maximum mouse movement between clicks to make a double-click.\n\
-Value is the number of pixels the mouse may have moved horizontally or\n\
-vertically between two clicks to make a double-click.");
+On window-system frames, value is the number of pixels the mouse may have\n\
+moved horizontally or vertically between two clicks to make a double-click.\n\
+On non window-system frames, value is interpreted in units of 1/8 characters\n\
+instead of pixels.");
double_click_fuzz = 3;
DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus,