diff options
| author | Kim F. Storm | 2005-10-13 22:41:21 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-10-13 22:41:21 +0000 |
| commit | bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed (patch) | |
| tree | 9d7cfeb0396a66f6b179ef3ae0f25691d0bb17b0 | |
| parent | 0ea1a8afa4524e244008a7d88c3f03d2ff16a6ed (diff) | |
| download | emacs-bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed.tar.gz emacs-bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed.zip | |
(note_mouse_movement): Return 1 if mouse moved; 0 otherwise.
(handle_one_xevent): Only clear help_echo_string; restore it if
note_mouse_movement didn't record any mouse movement.
| -rw-r--r-- | src/xterm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index d9a4f9d68f6..0f18a3ae9fc 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3582,7 +3582,7 @@ construct_mouse_click (result, event, f) | |||
| 3582 | static XMotionEvent last_mouse_motion_event; | 3582 | static XMotionEvent last_mouse_motion_event; |
| 3583 | static Lisp_Object last_mouse_motion_frame; | 3583 | static Lisp_Object last_mouse_motion_frame; |
| 3584 | 3584 | ||
| 3585 | static void | 3585 | static int |
| 3586 | note_mouse_movement (frame, event) | 3586 | note_mouse_movement (frame, event) |
| 3587 | FRAME_PTR frame; | 3587 | FRAME_PTR frame; |
| 3588 | XMotionEvent *event; | 3588 | XMotionEvent *event; |
| @@ -3596,10 +3596,11 @@ note_mouse_movement (frame, event) | |||
| 3596 | frame->mouse_moved = 1; | 3596 | frame->mouse_moved = 1; |
| 3597 | last_mouse_scroll_bar = Qnil; | 3597 | last_mouse_scroll_bar = Qnil; |
| 3598 | note_mouse_highlight (frame, -1, -1); | 3598 | note_mouse_highlight (frame, -1, -1); |
| 3599 | return 1; | ||
| 3599 | } | 3600 | } |
| 3600 | 3601 | ||
| 3601 | /* Has the mouse moved off the glyph it was on at the last sighting? */ | 3602 | /* Has the mouse moved off the glyph it was on at the last sighting? */ |
| 3602 | else if (event->x < last_mouse_glyph.x | 3603 | if (event->x < last_mouse_glyph.x |
| 3603 | || event->x >= last_mouse_glyph.x + last_mouse_glyph.width | 3604 | || event->x >= last_mouse_glyph.x + last_mouse_glyph.width |
| 3604 | || event->y < last_mouse_glyph.y | 3605 | || event->y < last_mouse_glyph.y |
| 3605 | || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) | 3606 | || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) |
| @@ -3609,7 +3610,10 @@ note_mouse_movement (frame, event) | |||
| 3609 | note_mouse_highlight (frame, event->x, event->y); | 3610 | note_mouse_highlight (frame, event->x, event->y); |
| 3610 | /* Remember which glyph we're now on. */ | 3611 | /* Remember which glyph we're now on. */ |
| 3611 | remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph); | 3612 | remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph); |
| 3613 | return 1; | ||
| 3612 | } | 3614 | } |
| 3615 | |||
| 3616 | return 0; | ||
| 3613 | } | 3617 | } |
| 3614 | 3618 | ||
| 3615 | 3619 | ||
| @@ -6483,8 +6487,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6483 | case MotionNotify: | 6487 | case MotionNotify: |
| 6484 | { | 6488 | { |
| 6485 | previous_help_echo_string = help_echo_string; | 6489 | previous_help_echo_string = help_echo_string; |
| 6486 | help_echo_string = help_echo_object = help_echo_window = Qnil; | 6490 | help_echo_string = Qnil; |
| 6487 | help_echo_pos = -1; | ||
| 6488 | 6491 | ||
| 6489 | if (dpyinfo->grabbed && last_mouse_frame | 6492 | if (dpyinfo->grabbed && last_mouse_frame |
| 6490 | && FRAME_LIVE_P (last_mouse_frame)) | 6493 | && FRAME_LIVE_P (last_mouse_frame)) |
| @@ -6523,7 +6526,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6523 | 6526 | ||
| 6524 | last_window=window; | 6527 | last_window=window; |
| 6525 | } | 6528 | } |
| 6526 | note_mouse_movement (f, &event.xmotion); | 6529 | if (!note_mouse_movement (f, &event.xmotion)) |
| 6530 | help_echo_string = previous_help_echo_string; | ||
| 6527 | } | 6531 | } |
| 6528 | else | 6532 | else |
| 6529 | { | 6533 | { |