emacs-diffs
[Top][All Lists]
Advanced

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

master 9d1ae05442: Clear mouse highlight when mouse moves outside edit w


From: Po Lu
Subject: master 9d1ae05442: Clear mouse highlight when mouse moves outside edit widget
Date: Tue, 8 Feb 2022 01:18:46 -0500 (EST)

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

    Clear mouse highlight when mouse moves outside edit widget
    
    * src/xterm.c (handle_one_xevent): Clear mouse highlight when
    leaving the edit widget.  Otherwise, it stays around on the
    toolbar after the mouse is moved onto the menu bar.
---
 src/xterm.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index b49441ddb7..8bdb3c9ea1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10068,8 +10068,17 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       if (x_top_window_to_frame (dpyinfo, event->xcrossing.window))
        x_detect_focus_change (dpyinfo, any, event, &inev.ie);
 
+#if defined USE_X_TOOLKIT
+      /* If the mouse leaves the edit widget, then any mouse highlight
+        should be cleared.  */
+      f = x_window_to_frame (dpyinfo, event->xcrossing.window);
+
+      if (!f)
+       f = x_top_window_to_frame (dpyinfo, event->xcrossing.window);
+#else
       f = x_top_window_to_frame (dpyinfo, event->xcrossing.window);
-#if defined HAVE_X_TOOLKIT && defined HAVE_XINPUT2
+#endif
+#if defined USE_X_TOOLKIT && defined HAVE_XINPUT2
       /* The XI2 event mask is set on the frame widget, so this event
         likely originates from the shell widget, which we aren't
         interested in.  */
@@ -10783,15 +10792,15 @@ handle_one_xevent (struct x_display_info *dpyinfo,
            if (any)
              x_detect_focus_change (dpyinfo, any, event, &inev.ie);
 
-           if (!any)
-             any = x_any_window_to_frame (dpyinfo, leave->event);
-
 #ifndef USE_X_TOOLKIT
            f = x_top_window_to_frame (dpyinfo, leave->event);
 #else
            /* On Xt builds that have XI2, the enter and leave event
               masks are set on the frame widget's window.  */
            f = x_window_to_frame (dpyinfo, leave->event);
+
+           if (!f)
+             f = x_top_window_to_frame (dpyinfo, leave->event);
 #endif
            if (f)
              {



reply via email to

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