aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-14 09:05:48 +0800
committerPo Lu2022-03-14 09:07:13 +0800
commita63bac7adef9b17521e804a67a574764d6e8b2b6 (patch)
treee0dae83f85239bde175cce7c3d450333add70614 /src
parent485a8fcbf4974466022798c0159e954af9482cf1 (diff)
downloademacs-a63bac7adef9b17521e804a67a574764d6e8b2b6.tar.gz
emacs-a63bac7adef9b17521e804a67a574764d6e8b2b6.zip
Fix tool-bar highlight persisting after mouse moves onto WM frame
* src/xterm.c (handle_one_xevent): Always report MotionNotify coordinates in terms of the edit widget.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 397b5bfc7a8..06cb9332095 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11210,6 +11210,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11210 11210
11211 case MotionNotify: 11211 case MotionNotify:
11212 { 11212 {
11213 XMotionEvent xmotion = event->xmotion;
11214
11213 previous_help_echo_string = help_echo_string; 11215 previous_help_echo_string = help_echo_string;
11214 help_echo_string = Qnil; 11216 help_echo_string = Qnil;
11215 11217
@@ -11250,8 +11252,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11250 || !NILP (focus_follows_mouse))) 11252 || !NILP (focus_follows_mouse)))
11251 { 11253 {
11252 static Lisp_Object last_mouse_window; 11254 static Lisp_Object last_mouse_window;
11255
11256 if (xmotion.window != FRAME_X_WINDOW (f))
11257 {
11258 XTranslateCoordinates (FRAME_X_DISPLAY (f),
11259 xmotion.window, FRAME_X_WINDOW (f),
11260 xmotion.x, xmotion.y, &xmotion.x,
11261 &xmotion.y, &xmotion.subwindow);
11262 xmotion.window = FRAME_X_WINDOW (f);
11263 }
11264
11253 Lisp_Object window = window_from_coordinates 11265 Lisp_Object window = window_from_coordinates
11254 (f, event->xmotion.x, event->xmotion.y, 0, false, false); 11266 (f, xmotion.x, xmotion.y, 0, false, false);
11255 11267
11256 /* A window will be autoselected only when it is not 11268 /* A window will be autoselected only when it is not
11257 selected now and the last mouse movement event was 11269 selected now and the last mouse movement event was
@@ -12367,6 +12379,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
12367#endif 12379#endif
12368 if (f) 12380 if (f)
12369 { 12381 {
12382 if (xev->event != FRAME_X_WINDOW (f))
12383 {
12384 XTranslateCoordinates (FRAME_X_DISPLAY (f),
12385 xev->event, FRAME_X_WINDOW (f),
12386 ev.x, ev.y, &ev.x, &ev.y, &dummy);
12387 ev.window = FRAME_X_WINDOW (f);
12388 }
12389
12370 /* Maybe generate a SELECT_WINDOW_EVENT for 12390 /* Maybe generate a SELECT_WINDOW_EVENT for
12371 `mouse-autoselect-window' but don't let popup menus 12391 `mouse-autoselect-window' but don't let popup menus
12372 interfere with this (Bug#1261). */ 12392 interfere with this (Bug#1261). */