# HG changeset patch # User Gerd Moellmann # Date 983892615 0 # Node ID d9bb01d5dbbba6f67a7a71aa5555fcdecf3988fb # Parent 1879cd230f9c3dbbd49387b67e4e92ae51c4b409 (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. diff -r 1879cd230f9c -r d9bb01d5dbbb src/xterm.c --- 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;