[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in incremental undrawing of mouseover highlighting
From: |
Chong Yidong |
Subject: |
Re: Bug in incremental undrawing of mouseover highlighting |
Date: |
Mon, 20 Nov 2006 14:22:47 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux) |
Bob Rogers <address@hidden> writes:
> It seems that mouseover background highlighting is not undrawn if
> replaced by the same unhighlighted text. This happens in the CVS
> version as of late on 11-Nov.
The problem occurs because note_mouse_highlight checks only the window
and glyph positions to see if it needs to maintain the mouse
highlight. The relevant code is in xdisp.c:22819:
same_region = (EQ (window, dpyinfo->mouse_face_window)
&& vpos >= dpyinfo->mouse_face_beg_row
&& vpos <= dpyinfo->mouse_face_end_row
&& (vpos > dpyinfo->mouse_face_beg_row
|| hpos >= dpyinfo->mouse_face_beg_col)
&& (vpos < dpyinfo->mouse_face_end_row
|| hpos < dpyinfo->mouse_face_end_col
|| dpyinfo->mouse_face_past_end));
As far as I can tell, the simplest fix is to tell set_window_buffer to
reset the mouse face if the mouse face used to be associated with that
window. The patch below implements this.
*** emacs/src/window.c.~1.564.~ 2006-10-30 09:06:42.000000000 -0500
--- emacs/src/window.c 2006-11-20 14:13:08.000000000 -0500
***************
*** 3265,3270 ****
--- 3265,3275 ----
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
int count = SPECPDL_INDEX ();
+ #ifdef HAVE_WINDOW_SYSTEM
+ struct frame *f = XFRAME (w->frame);
+ Display_Info *dpyinfo = (f && FRAME_X_OUTPUT (f)) ?
+ FRAME_X_DISPLAY_INFO (f) : NULL;
+ #endif
w->buffer = buffer;
***************
*** 3345,3350 ****
--- 3350,3360 ----
call1 (Vrun_hooks, Qwindow_configuration_change_hook);
}
+ #ifdef HAVE_WINDOW_SYSTEM
+ if (dpyinfo && EQ (window, dpyinfo->mouse_face_window))
+ clear_mouse_face (dpyinfo);
+ #endif
+
unbind_to (count, Qnil);
}
- Bug in incremental undrawing of mouseover highlighting, Bob Rogers, 2006/11/19
- Re: Bug in incremental undrawing of mouseover highlighting, Eli Zaretskii, 2006/11/20
- Re: Bug in incremental undrawing of mouseover highlighting, Chong Yidong, 2006/11/22
- Re: Bug in incremental undrawing of mouseover highlighting, Eli Zaretskii, 2006/11/22
- Re: Bug in incremental undrawing of mouseover highlighting, Nick Roberts, 2006/11/22