From 8bd189fb2ff8a752d65c926959341034de32ff04 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 30 May 2001 11:19:43 +0000 Subject: [PATCH] (note_mouse_highlight): If an overlapping overlay exists, but we find that we highlight the same overlay as before, don't do the highlighting again. --- src/ChangeLog | 6 ++++++ src/xterm.c | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3c851d1c7f6..26ee254877a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-05-30 Gerd Moellmann + + * xterm.c (note_mouse_highlight): If an overlapping overlay + exists, but we find that we highlight the same overlay as before, + don't do the highlighting again. + 2001-05-29 Gerd Moellmann * xmenu.c (single_submenu, xmenu_show) [!HAVE_MULTILINGUAL_MENU]: diff --git a/src/xterm.c b/src/xterm.c index 394b75cfe6c..f6f3f599798 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6959,10 +6959,6 @@ note_mouse_highlight (f, x, y) || (OVERLAYP (dpyinfo->mouse_face_overlay) && mouse_face_overlay_overlaps (dpyinfo->mouse_face_overlay))) { - /* Clear the display of the old active region, if any. */ - if (clear_mouse_face (dpyinfo)) - cursor = None; - /* Find the highest priority overlay that has a mouse-face property. */ overlay = Qnil; @@ -6972,8 +6968,19 @@ note_mouse_highlight (f, x, y) if (!NILP (mouse_face)) overlay = overlay_vec[i]; } - dpyinfo->mouse_face_overlay = overlay; + + /* If we're actually highlighting the same overlay as + before, there's no need to do that again. */ + if (!NILP (overlay) + && EQ (overlay, dpyinfo->mouse_face_overlay)) + goto check_help_echo; + dpyinfo->mouse_face_overlay = overlay; + + /* Clear the display of the old active region, if any. */ + if (clear_mouse_face (dpyinfo)) + cursor = None; + /* If no overlay applies, get a text property. */ if (NILP (overlay)) mouse_face = Fget_text_property (position, Qmouse_face, object); @@ -7085,6 +7092,8 @@ note_mouse_highlight (f, x, y) } } + check_help_echo: + /* Look for a `help-echo' property. */ { Lisp_Object help, overlay; -- 2.39.5