summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-07-25 10:07:30 +0800
committerPo Lu <luangruo@yahoo.com>2022-07-25 10:07:30 +0800
commit3c23ae13f044083c928df14ff441f841fcdc3b4f (patch)
treeb79bd27661e99e3c34e9f4de4bf723c6ea1e79f6
parentb1f14e94ada90c266e3e6683d401e567397c4910 (diff)
downloademacs-3c23ae13f044083c928df14ff441f841fcdc3b4f.tar.gz
emacs-3c23ae13f044083c928df14ff441f841fcdc3b4f.tar.bz2
emacs-3c23ae13f044083c928df14ff441f841fcdc3b4f.zip
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.
-rw-r--r--src/xterm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index da909f337f9..e953f54d6da 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