diff options
author | Kim F. Storm <storm@cua.dk> | 2005-10-13 22:41:21 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2005-10-13 22:41:21 +0000 |
commit | bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed (patch) | |
tree | 9d7cfeb0396a66f6b179ef3ae0f25691d0bb17b0 /src/xterm.c | |
parent | 0ea1a8afa4524e244008a7d88c3f03d2ff16a6ed (diff) | |
download | emacs-bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed.tar.gz emacs-bb339c57aaed49ad5e9dddcab8f70ac35a94d7ed.tar.bz2 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.
Diffstat (limited to 'src/xterm.c')
-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) static XMotionEvent last_mouse_motion_event; static Lisp_Object last_mouse_motion_frame; -static void +static int note_mouse_movement (frame, event) FRAME_PTR frame; XMotionEvent *event; @@ -3596,10 +3596,11 @@ note_mouse_movement (frame, event) frame->mouse_moved = 1; last_mouse_scroll_bar = Qnil; note_mouse_highlight (frame, -1, -1); + return 1; } /* Has the mouse moved off the glyph it was on at the last sighting? */ - else if (event->x < last_mouse_glyph.x + if (event->x < last_mouse_glyph.x || event->x >= last_mouse_glyph.x + last_mouse_glyph.width || event->y < last_mouse_glyph.y || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) @@ -3609,7 +3610,10 @@ note_mouse_movement (frame, event) note_mouse_highlight (frame, event->x, event->y); /* Remember which glyph we're now on. */ remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph); + return 1; } + + return 0; } @@ -6483,8 +6487,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) case MotionNotify: { previous_help_echo_string = help_echo_string; - help_echo_string = help_echo_object = help_echo_window = Qnil; - help_echo_pos = -1; + help_echo_string = Qnil; if (dpyinfo->grabbed && last_mouse_frame && FRAME_LIVE_P (last_mouse_frame)) @@ -6523,7 +6526,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) last_window=window; } - note_mouse_movement (f, &event.xmotion); + if (!note_mouse_movement (f, &event.xmotion)) + help_echo_string = previous_help_echo_string; } else { |