[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3c23ae13f0 2/3: Fix mouse face handling with tooltips
From: |
Po Lu |
Subject: |
master 3c23ae13f0 2/3: Fix mouse face handling with tooltips |
Date: |
Sun, 24 Jul 2022 22:09:06 -0400 (EDT) |
branch: master
commit 3c23ae13f044083c928df14ff441f841fcdc3b4f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix mouse face handling with tooltips
* src/xterm.c (handle_one_xevent): Clear last_mouse_motion_frame
and last_mouse_glyph_frame on LeaveNotify. Otherwise, mouse
face will be restored by gui_redo_mouse_highlight and will not
be restored if an EnterNotify is later sent on top of the same
glyph.
---
src/xterm.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/xterm.c b/src/xterm.c
index da909f337f..e953f54d6d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -18303,6 +18303,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#endif
if (f)
{
+ /* Now clear dpyinfo->last_mouse_motion_frame, or
+ gui_redo_mouse_highlight will end up highlighting the
+ last known poisition of the mouse if a tooltip frame is
+ later unmapped. */
+
+ if (f == dpyinfo->last_mouse_motion_frame)
+ dpyinfo->last_mouse_motion_frame = NULL;
+
+ /* Something similar applies to
+ dpyinfo->last_mouse_glyph_frame. */
+ if (f == dpyinfo->last_mouse_glyph_frame)
+ dpyinfo->last_mouse_glyph_frame = NULL;
+
if (f == hlinfo->mouse_face_mouse_frame)
{
/* If we move outside the frame, then we're
@@ -19753,8 +19766,22 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (!f)
f = x_top_window_to_frame (dpyinfo, leave->event);
#endif
+
if (f)
{
+ /* Now clear dpyinfo->last_mouse_motion_frame, or
+ gui_redo_mouse_highlight will end up highlighting
+ the last known poisition of the mouse if a
+ tooltip frame is later unmapped. */
+
+ if (f == dpyinfo->last_mouse_motion_frame)
+ dpyinfo->last_mouse_motion_frame = NULL;
+
+ /* Something similar applies to
+ dpyinfo->last_mouse_glyph_frame. */
+ if (f == dpyinfo->last_mouse_glyph_frame)
+ dpyinfo->last_mouse_glyph_frame = NULL;
+
if (f == hlinfo->mouse_face_mouse_frame)
{
/* If we move outside the frame, then we're