diff options
| author | YAMAMOTO Mitsuharu | 2005-10-18 08:07:06 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-10-18 08:07:06 +0000 |
| commit | 0e41b66d96847eb0dbe6598420f5d7eb301b4659 (patch) | |
| tree | f4ae8b683c1d2f7030b344379f5a65b5608866f1 /src | |
| parent | 1405937493f3ede793a012e897f7e1527192b4da (diff) | |
| download | emacs-0e41b66d96847eb0dbe6598420f5d7eb301b4659.tar.gz emacs-0e41b66d96847eb0dbe6598420f5d7eb301b4659.zip | |
(note_mouse_movement): Use PtInRect.
(XTread_socket): Also ignore mouse motion just before a button
release event. Don't process button release event when mouse is
not grabbed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/macterm.c b/src/macterm.c index 99536072a5e..4b2b8c998ed 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -3910,10 +3910,7 @@ note_mouse_movement (frame, pos) | |||
| 3910 | return 1; | 3910 | return 1; |
| 3911 | } | 3911 | } |
| 3912 | /* Has the mouse moved off the glyph it was on at the last sighting? */ | 3912 | /* Has the mouse moved off the glyph it was on at the last sighting? */ |
| 3913 | if (pos->h < last_mouse_glyph.left | 3913 | if (!PtInRect (*pos, &last_mouse_glyph)) |
| 3914 | || pos->h >= last_mouse_glyph.right | ||
| 3915 | || pos->v < last_mouse_glyph.top | ||
| 3916 | || pos->v >= last_mouse_glyph.bottom) | ||
| 3917 | { | 3914 | { |
| 3918 | frame->mouse_moved = 1; | 3915 | frame->mouse_moved = 1; |
| 3919 | last_mouse_scroll_bar = Qnil; | 3916 | last_mouse_scroll_bar = Qnil; |
| @@ -9521,7 +9518,8 @@ XTread_socket (sd, expected, hold_quit) | |||
| 9521 | } | 9518 | } |
| 9522 | } | 9519 | } |
| 9523 | 9520 | ||
| 9524 | if (er.what != mouseDown && part_code != inContent) | 9521 | if (er.what != mouseDown && |
| 9522 | (part_code != inContent || dpyinfo->grabbed == 0)) | ||
| 9525 | break; | 9523 | break; |
| 9526 | 9524 | ||
| 9527 | switch (part_code) | 9525 | switch (part_code) |
| @@ -9644,12 +9642,6 @@ XTread_socket (sd, expected, hold_quit) | |||
| 9644 | { | 9642 | { |
| 9645 | dpyinfo->grabbed |= (1 << inev.code); | 9643 | dpyinfo->grabbed |= (1 << inev.code); |
| 9646 | last_mouse_frame = f; | 9644 | last_mouse_frame = f; |
| 9647 | /* Ignore any mouse motion that happened | ||
| 9648 | before this event; any subsequent | ||
| 9649 | mouse-movement Emacs events should reflect | ||
| 9650 | only motion after the ButtonPress. */ | ||
| 9651 | if (f != 0) | ||
| 9652 | f->mouse_moved = 0; | ||
| 9653 | 9645 | ||
| 9654 | if (!tool_bar_p) | 9646 | if (!tool_bar_p) |
| 9655 | last_tool_bar_item = -1; | 9647 | last_tool_bar_item = -1; |
| @@ -9665,6 +9657,13 @@ XTread_socket (sd, expected, hold_quit) | |||
| 9665 | dpyinfo->grabbed &= ~(1 << inev.code); | 9657 | dpyinfo->grabbed &= ~(1 << inev.code); |
| 9666 | } | 9658 | } |
| 9667 | 9659 | ||
| 9660 | /* Ignore any mouse motion that happened before | ||
| 9661 | this event; any subsequent mouse-movement Emacs | ||
| 9662 | events should reflect only motion after the | ||
| 9663 | ButtonPress. */ | ||
| 9664 | if (f != 0) | ||
| 9665 | f->mouse_moved = 0; | ||
| 9666 | |||
| 9668 | #ifdef USE_TOOLKIT_SCROLL_BARS | 9667 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 9669 | if (inev.kind == MOUSE_CLICK_EVENT) | 9668 | if (inev.kind == MOUSE_CLICK_EVENT) |
| 9670 | #endif | 9669 | #endif |