diff options
| author | Gerd Moellmann | 2001-08-13 09:27:43 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-08-13 09:27:43 +0000 |
| commit | c5cf21093ae4ee11b4385fb9d69c9cfb077e5c42 (patch) | |
| tree | 5f7f814045cc2026a1cee1b31e04c6b26a2af095 | |
| parent | d6f207b78d970d968bd5505873cf197161a26d25 (diff) | |
| download | emacs-c5cf21093ae4ee11b4385fb9d69c9cfb077e5c42.tar.gz emacs-c5cf21093ae4ee11b4385fb9d69c9cfb077e5c42.zip | |
(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.
| -rw-r--r-- | src/keyboard.c | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 54457612370..b15c213912c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -4690,6 +4690,7 @@ make_lispy_event (event) | |||
| 4690 | Lisp_Object position; | 4690 | Lisp_Object position; |
| 4691 | Lisp_Object *start_pos_ptr; | 4691 | Lisp_Object *start_pos_ptr; |
| 4692 | Lisp_Object start_pos; | 4692 | Lisp_Object start_pos; |
| 4693 | Lisp_Object window; | ||
| 4693 | 4694 | ||
| 4694 | position = Qnil; | 4695 | position = Qnil; |
| 4695 | 4696 | ||
| @@ -4697,8 +4698,7 @@ make_lispy_event (event) | |||
| 4697 | if (event->kind == mouse_click) | 4698 | if (event->kind == mouse_click) |
| 4698 | { | 4699 | { |
| 4699 | int part; | 4700 | int part; |
| 4700 | FRAME_PTR f = XFRAME (event->frame_or_window); | 4701 | struct frame *f = XFRAME (event->frame_or_window); |
| 4701 | Lisp_Object window; | ||
| 4702 | Lisp_Object posn; | 4702 | Lisp_Object posn; |
| 4703 | Lisp_Object string_info = Qnil; | 4703 | Lisp_Object string_info = Qnil; |
| 4704 | int row, column; | 4704 | int row, column; |
| @@ -4836,7 +4836,6 @@ make_lispy_event (event) | |||
| 4836 | else | 4836 | else |
| 4837 | { | 4837 | { |
| 4838 | /* It's a scrollbar click. */ | 4838 | /* It's a scrollbar click. */ |
| 4839 | Lisp_Object window; | ||
| 4840 | Lisp_Object portion_whole; | 4839 | Lisp_Object portion_whole; |
| 4841 | Lisp_Object part; | 4840 | Lisp_Object part; |
| 4842 | 4841 | ||
| @@ -4864,16 +4863,34 @@ make_lispy_event (event) | |||
| 4864 | start_pos = *start_pos_ptr; | 4863 | start_pos = *start_pos_ptr; |
| 4865 | *start_pos_ptr = Qnil; | 4864 | *start_pos_ptr = Qnil; |
| 4866 | 4865 | ||
| 4867 | is_double = (button == last_mouse_button | 4866 | { |
| 4868 | && (abs (XINT (event->x) - last_mouse_x) | 4867 | /* On window-system frames, use the value of |
| 4869 | <= double_click_fuzz) | 4868 | double-click-fuzz as is. On other frames, interpret it |
| 4870 | && (abs (XINT (event->y) - last_mouse_y) | 4869 | as a multiple of 1/8 characters. */ |
| 4871 | <= double_click_fuzz) | 4870 | struct frame *f; |
| 4872 | && button_down_time != 0 | 4871 | int fuzz; |
| 4873 | && (EQ (Vdouble_click_time, Qt) | 4872 | |
| 4874 | || (INTEGERP (Vdouble_click_time) | 4873 | if (WINDOWP (event->frame_or_window)) |
| 4875 | && ((int)(event->timestamp - button_down_time) | 4874 | f = XFRAME (XWINDOW (event->frame_or_window)->frame); |
| 4876 | < XINT (Vdouble_click_time))))); | 4875 | else if (FRAMEP (event->frame_or_window)) |
| 4876 | f = XFRAME (event->frame_or_window); | ||
| 4877 | else | ||
| 4878 | abort (); | ||
| 4879 | |||
| 4880 | if (FRAME_WINDOW_P (f)) | ||
| 4881 | fuzz = double_click_fuzz; | ||
| 4882 | else | ||
| 4883 | fuzz = double_click_fuzz / 8; | ||
| 4884 | |||
| 4885 | is_double = (button == last_mouse_button | ||
| 4886 | && (abs (XINT (event->x) - last_mouse_x) <= fuzz) | ||
| 4887 | && (abs (XINT (event->y) - last_mouse_y) <= fuzz) | ||
| 4888 | && button_down_time != 0 | ||
| 4889 | && (EQ (Vdouble_click_time, Qt) | ||
| 4890 | || (INTEGERP (Vdouble_click_time) | ||
| 4891 | && ((int)(event->timestamp - button_down_time) | ||
| 4892 | < XINT (Vdouble_click_time))))); | ||
| 4893 | } | ||
| 4877 | 4894 | ||
| 4878 | last_mouse_button = button; | 4895 | last_mouse_button = button; |
| 4879 | last_mouse_x = XINT (event->x); | 4896 | last_mouse_x = XINT (event->x); |
| @@ -10541,8 +10558,10 @@ by position only."); | |||
| 10541 | 10558 | ||
| 10542 | DEFVAR_INT ("double-click-fuzz", &double_click_fuzz, | 10559 | DEFVAR_INT ("double-click-fuzz", &double_click_fuzz, |
| 10543 | "*Maximum mouse movement between clicks to make a double-click.\n\ | 10560 | "*Maximum mouse movement between clicks to make a double-click.\n\ |
| 10544 | Value is the number of pixels the mouse may have moved horizontally or\n\ | 10561 | On window-system frames, value is the number of pixels the mouse may have\n\ |
| 10545 | vertically between two clicks to make a double-click."); | 10562 | moved horizontally or vertically between two clicks to make a double-click.\n\ |
| 10563 | On non window-system frames, value is interpreted in units of 1/8 characters\n\ | ||
| 10564 | instead of pixels."); | ||
| 10546 | double_click_fuzz = 3; | 10565 | double_click_fuzz = 3; |
| 10547 | 10566 | ||
| 10548 | DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus, | 10567 | DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus, |