From: Stefan Monnier Date: Tue, 4 Oct 2005 04:23:12 +0000 (+0000) Subject: (make_lispy_event): If point has moved between down and up event, make it X-Git-Tag: emacs-pretest-22.0.90~6837 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4156359ea5abc7affe6ed1e93bec8e4b1cd4b977;p=emacs.git (make_lispy_event): If point has moved between down and up event, make it a drag, not a click, to mirror what mouse-drag-region expects. --- diff --git a/src/ChangeLog b/src/ChangeLog index 351dbcf1e39..d57a739d45a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-10-04 Stefan Monnier + + * keyboard.c (make_lispy_event): If point has moved between down and up + event, make it a drag, not a click, to mirror what + mouse-drag-region expects. + 2005-10-02 Dan Nicolaescu * lisp.h (fatal): Undo previous change. @@ -17,8 +23,8 @@ * macfns.c (start_hourglass): Apply 2005-05-07 change for xfns.c. (x_create_tip_frame) [GLYPH_DEBUG]: Uncomment debug code. - (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]: Try - ATSUI-compatible 12pt Monaco font first. + (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]: + Try ATSUI-compatible 12pt Monaco font first. * macgui.h (struct _XCharStruct): New member valid_p. (STORE_XCHARSTRUCT): Set valid_p. @@ -41,8 +47,7 @@ 2005-09-30 Dan Nicolaescu - * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct - type. + * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type. * xterm.c (handle_one_xevent, handle_one_xevent): Likewise. * unexelf.c (fatal): Fix prototype. @@ -51,8 +56,7 @@ * regex.c (re_char): Move typedef ... * regex.h (re_char): ... here. - (re_iswctype, re_wctype, re_set_whitespace_regexp): New - prototypes. + (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes. * emacs.c (malloc_set_state): Fix return type. (endif): Fix type. @@ -74,8 +78,7 @@ (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes. (emacs_blocked_free): Change definition to match __free_hook. (emacs_blocked_malloc): Change definition to match __malloc_hook. - (emacs_blocked_realloc): Change definition to match - __realloc_hook. + (emacs_blocked_realloc): Change definition to match __realloc_hook. 2005-09-30 Romain Francoise @@ -132,8 +135,8 @@ 2005-09-23 Dan Nicolaescu - * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): Define - BROKEN_GET_CURRENT_DIR_NAME. + * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME): + Define BROKEN_GET_CURRENT_DIR_NAME. * sysdep.c (get_current_dir_name): Also define if BROKEN_GET_CURRENT_DIR_NAME. diff --git a/src/keyboard.c b/src/keyboard.c index f41ce352cb8..3826d460e3f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5507,13 +5507,23 @@ make_lispy_event (event) if (CONSP (down) && INTEGERP (XCAR (down)) && INTEGERP (XCDR (down))) { - xdiff = XFASTINT (event->x) - XFASTINT (XCAR (down)); - ydiff = XFASTINT (event->y) - XFASTINT (XCDR (down)); + xdiff = XINT (event->x) - XINT (XCAR (down)); + ydiff = XINT (event->y) - XINT (XCDR (down)); } if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz - && ydiff < double_click_fuzz - && ydiff > - double_click_fuzz) + && ydiff < double_click_fuzz && ydiff > - double_click_fuzz + /* Maybe the mouse has moved a lot, caused scrolling, and + eventually ended up at the same screen position (but + not buffer position) in which case it is a drag, not + a click. */ + /* FIXME: OTOH if the buffer position has changed + because of a timer or process filter rather than + because of mouse movement, it should be considered as + a click. But mouse-drag-region completely ignores + this case and it hasn't caused any real problem, so + it's probably OK to ignore it as well. */ + && EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position)))) /* Mouse hasn't moved (much). */ event->modifiers |= click_modifier; else