diff src/xterm.c @ 36587:d9bb01d5dbbb

(note_mouse_highlight): Call mouse_face_overlay_overlaps to detect a case where we have to highlight a different region despite not having left the currently highlighted region. Set mouse_face_overlay in the x_display_info. (x_term_init): Initialze the x_display_info's mouse_face_overlay.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 06 Mar 2001 15:30:15 +0000
parents b6b9363f3e20
children 3813a1116259
line wrap: on
line diff
--- a/src/xterm.c	Tue Mar 06 15:29:39 2001 +0000
+++ b/src/xterm.c	Tue Mar 06 15:30:15 2001 +0000
@@ -6723,7 +6723,7 @@
 
       /* Check for mouse-face and help-echo.  */
       {
-	Lisp_Object mouse_face, overlay, position;
+	Lisp_Object mouse_face = Qnil, overlay, position;
 	Lisp_Object *overlay_vec;
 	int len, noverlays;
 	struct buffer *obuf;
@@ -6769,7 +6769,14 @@
 		   || hpos >= dpyinfo->mouse_face_beg_col)
 	       && (vpos < dpyinfo->mouse_face_end_row
 		   || hpos < dpyinfo->mouse_face_end_col
-		   || dpyinfo->mouse_face_past_end)))
+		   || dpyinfo->mouse_face_past_end))
+	    /* If there exists an overlay with mouse-face overlapping
+	       the one we are currently highlighting, we have to
+	       check if we enter the overlapping overlay, and then
+	       highlight only that.  */
+	    || (OVERLAYP (dpyinfo->mouse_face_overlay)
+		&& mouse_face_overlay_overlaps (dpyinfo->mouse_face_overlay)))
+	  
 	  {
 	    /* Clear the display of the old active region, if any.  */
 	    clear_mouse_face (dpyinfo);
@@ -6790,8 +6797,10 @@
 	    if (NILP (overlay))
 	      mouse_face = Fget_text_property (position, Qmouse_face, w->buffer);
 
+	    dpyinfo->mouse_face_overlay = overlay;
+	    
 	    /* Handle the overlay case.  */
-	    if (! NILP (overlay))
+	    if (!NILP (overlay))
 	      {
 		/* Find the range of text around this char that
 		   should be active.  */
@@ -13779,6 +13788,7 @@
   dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
   dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
   dpyinfo->mouse_face_window = Qnil;
+  dpyinfo->mouse_face_overlay = Qnil;
   dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0;
   dpyinfo->mouse_face_defer = 0;
   dpyinfo->x_focus_frame = 0;