diff options
| author | Kim F. Storm | 2006-12-15 00:22:57 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-12-15 00:22:57 +0000 |
| commit | 3b0cdcef37e678cb785d828d7555f9d641ed4641 (patch) | |
| tree | bc75ea806697951e948e4c1e55b4edda929a024d /src | |
| parent | cbaa9c445109cfb5a4a9854656feb811acccddf4 (diff) | |
| download | emacs-3b0cdcef37e678cb785d828d7555f9d641ed4641.tar.gz emacs-3b0cdcef37e678cb785d828d7555f9d641ed4641.zip | |
(ignore_mouse_drag_p): New global var.
(some_mouse_moved): Return 0 if it is non-zero.
(make_lispy_event): Generate click event on mouse up if
ignore_mouse_drag_p is non-zero, even if mouse moved.
Clear ignore_mouse_drag_p on mouse down/up.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 2d5e419149f..b2d84dfba32 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1438,13 +1438,25 @@ usage: (track-mouse BODY ...) */) | |||
| 1438 | } | 1438 | } |
| 1439 | 1439 | ||
| 1440 | /* If mouse has moved on some frame, return one of those frames. | 1440 | /* If mouse has moved on some frame, return one of those frames. |
| 1441 | Return 0 otherwise. */ | 1441 | |
| 1442 | Return 0 otherwise. | ||
| 1443 | |||
| 1444 | If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement | ||
| 1445 | after resizing the tool-bar window. */ | ||
| 1446 | |||
| 1447 | int ignore_mouse_drag_p; | ||
| 1442 | 1448 | ||
| 1443 | static FRAME_PTR | 1449 | static FRAME_PTR |
| 1444 | some_mouse_moved () | 1450 | some_mouse_moved () |
| 1445 | { | 1451 | { |
| 1446 | Lisp_Object tail, frame; | 1452 | Lisp_Object tail, frame; |
| 1447 | 1453 | ||
| 1454 | if (ignore_mouse_drag_p) | ||
| 1455 | { | ||
| 1456 | //ignore_mouse_drag_p = 0; | ||
| 1457 | return 0; | ||
| 1458 | } | ||
| 1459 | |||
| 1448 | FOR_EACH_FRAME (tail, frame) | 1460 | FOR_EACH_FRAME (tail, frame) |
| 1449 | { | 1461 | { |
| 1450 | if (XFRAME (frame)->mouse_moved) | 1462 | if (XFRAME (frame)->mouse_moved) |
| @@ -5592,6 +5604,7 @@ make_lispy_event (event) | |||
| 5592 | double_click_count = 1; | 5604 | double_click_count = 1; |
| 5593 | button_down_time = event->timestamp; | 5605 | button_down_time = event->timestamp; |
| 5594 | *start_pos_ptr = Fcopy_alist (position); | 5606 | *start_pos_ptr = Fcopy_alist (position); |
| 5607 | ignore_mouse_drag_p = 0; | ||
| 5595 | } | 5608 | } |
| 5596 | 5609 | ||
| 5597 | /* Now we're releasing a button - check the co-ordinates to | 5610 | /* Now we're releasing a button - check the co-ordinates to |
| @@ -5627,8 +5640,13 @@ make_lispy_event (event) | |||
| 5627 | ydiff = XINT (event->y) - XINT (XCDR (down)); | 5640 | ydiff = XINT (event->y) - XINT (XCDR (down)); |
| 5628 | } | 5641 | } |
| 5629 | 5642 | ||
| 5630 | if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz | 5643 | if (ignore_mouse_drag_p) |
| 5631 | && ydiff < double_click_fuzz && ydiff > - double_click_fuzz | 5644 | { |
| 5645 | event->modifiers |= click_modifier; | ||
| 5646 | ignore_mouse_drag_p = 0; | ||
| 5647 | } | ||
| 5648 | else if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz | ||
| 5649 | && ydiff < double_click_fuzz && ydiff > - double_click_fuzz | ||
| 5632 | /* Maybe the mouse has moved a lot, caused scrolling, and | 5650 | /* Maybe the mouse has moved a lot, caused scrolling, and |
| 5633 | eventually ended up at the same screen position (but | 5651 | eventually ended up at the same screen position (but |
| 5634 | not buffer position) in which case it is a drag, not | 5652 | not buffer position) in which case it is a drag, not |