emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master fc071bf: Fix a minor problem with mouse-face on mod


From: Eli Zaretskii
Subject: [Emacs-diffs] master fc071bf: Fix a minor problem with mouse-face on mode line
Date: Thu, 21 May 2015 16:39:21 +0000

branch: master
commit fc071bf7c6a300f52142b92cf99c5a0e63b3e235
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix a minor problem with mouse-face on mode line
    
    * src/xdisp.c (note_mode_line_or_margin_highlight): Reset the
    mouse face also if the mouse pointer hovers above mode-line glyphs
    that don't come from any Lisp string.  (Bug#20620)
---
 src/xdisp.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 8123719..87f110e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -29159,6 +29159,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, 
int x, int y,
     }
 
   /* Change the mouse face according to what is under X/Y.  */
+  bool mouse_face_shown = false;
   if (STRINGP (string))
     {
       mouse_face = Fget_text_property (pos, Qmouse_face, string);
@@ -29281,13 +29282,18 @@ note_mode_line_or_margin_highlight (Lisp_Object 
window, int x, int y,
                                                                glyph->face_id,
                                                                true);
          show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+         mouse_face_shown = true;
 
          if (NILP (pointer))
            pointer = Qhand;
        }
-      else if ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))
-       clear_mouse_face (hlinfo);
     }
+
+  /* If mouse-face doesn't need to be shown, clear any existing
+     mouse-face.  */
+  if ((area == ON_MODE_LINE || area == ON_HEADER_LINE) && !mouse_face_shown)
+    clear_mouse_face (hlinfo);
+
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (f))
     define_frame_cursor1 (f, cursor, pointer);



reply via email to

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