emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a63bac7ade: Fix tool-bar highlight persisting after mouse moves o


From: Po Lu
Subject: master a63bac7ade: Fix tool-bar highlight persisting after mouse moves onto WM frame
Date: Sun, 13 Mar 2022 21:07:26 -0400 (EDT)

branch: master
commit a63bac7adef9b17521e804a67a574764d6e8b2b6
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index 397b5bfc7a..06cb933209 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11210,6 +11210,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
     case MotionNotify:
       {
+       XMotionEvent xmotion = event->xmotion;
+
         previous_help_echo_string = help_echo_string;
         help_echo_string = Qnil;
 
@@ -11250,8 +11252,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                    || !NILP (focus_follows_mouse)))
              {
                static Lisp_Object last_mouse_window;
+
+               if (xmotion.window != FRAME_X_WINDOW (f))
+                 {
+                   XTranslateCoordinates (FRAME_X_DISPLAY (f),
+                                          xmotion.window, FRAME_X_WINDOW (f),
+                                          xmotion.x, xmotion.y, &xmotion.x,
+                                          &xmotion.y, &xmotion.subwindow);
+                   xmotion.window = FRAME_X_WINDOW (f);
+                 }
+
                Lisp_Object window = window_from_coordinates
-                 (f, event->xmotion.x, event->xmotion.y, 0, false, false);
+                 (f, xmotion.x, xmotion.y, 0, false, false);
 
                /* A window will be autoselected only when it is not
                   selected now and the last mouse movement event was
@@ -12367,6 +12379,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #endif
              if (f)
                {
+                 if (xev->event != FRAME_X_WINDOW (f))
+                   {
+                     XTranslateCoordinates (FRAME_X_DISPLAY (f),
+                                            xev->event, FRAME_X_WINDOW (f),
+                                            ev.x, ev.y, &ev.x, &ev.y, &dummy);
+                     ev.window = FRAME_X_WINDOW (f);
+                   }
+
                  /* Maybe generate a SELECT_WINDOW_EVENT for
                     `mouse-autoselect-window' but don't let popup menus
                     interfere with this (Bug#1261).  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]