diff options
| author | Stefan Monnier | 2005-10-04 04:23:12 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-10-04 04:23:12 +0000 |
| commit | 4156359ea5abc7affe6ed1e93bec8e4b1cd4b977 (patch) | |
| tree | f288a44fbec1eefc8453708d3dca25b934c6783d /src/keyboard.c | |
| parent | c7bef55feee147fb2db36d60932ea68a024d4eaf (diff) | |
| download | emacs-4156359ea5abc7affe6ed1e93bec8e4b1cd4b977.tar.gz emacs-4156359ea5abc7affe6ed1e93bec8e4b1cd4b977.zip | |
(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.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 18 |
1 files changed, 14 insertions, 4 deletions
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) | |||
| 5507 | if (CONSP (down) | 5507 | if (CONSP (down) |
| 5508 | && INTEGERP (XCAR (down)) && INTEGERP (XCDR (down))) | 5508 | && INTEGERP (XCAR (down)) && INTEGERP (XCDR (down))) |
| 5509 | { | 5509 | { |
| 5510 | xdiff = XFASTINT (event->x) - XFASTINT (XCAR (down)); | 5510 | xdiff = XINT (event->x) - XINT (XCAR (down)); |
| 5511 | ydiff = XFASTINT (event->y) - XFASTINT (XCDR (down)); | 5511 | ydiff = XINT (event->y) - XINT (XCDR (down)); |
| 5512 | } | 5512 | } |
| 5513 | 5513 | ||
| 5514 | if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz | 5514 | if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz |
| 5515 | && ydiff < double_click_fuzz | 5515 | && ydiff < double_click_fuzz && ydiff > - double_click_fuzz |
| 5516 | && ydiff > - double_click_fuzz) | 5516 | /* Maybe the mouse has moved a lot, caused scrolling, and |
| 5517 | eventually ended up at the same screen position (but | ||
| 5518 | not buffer position) in which case it is a drag, not | ||
| 5519 | a click. */ | ||
| 5520 | /* FIXME: OTOH if the buffer position has changed | ||
| 5521 | because of a timer or process filter rather than | ||
| 5522 | because of mouse movement, it should be considered as | ||
| 5523 | a click. But mouse-drag-region completely ignores | ||
| 5524 | this case and it hasn't caused any real problem, so | ||
| 5525 | it's probably OK to ignore it as well. */ | ||
| 5526 | && EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position)))) | ||
| 5517 | /* Mouse hasn't moved (much). */ | 5527 | /* Mouse hasn't moved (much). */ |
| 5518 | event->modifiers |= click_modifier; | 5528 | event->modifiers |= click_modifier; |
| 5519 | else | 5529 | else |