From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Bug in incremental undrawing of mouseover highlighting Date: Mon, 20 Nov 2006 14:22:47 -0500 Message-ID: <87zmaludmg.fsf@cyd.mit.edu> References: <17760.56196.739515.442009@rgrjr.dyndns.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164050613 16346 80.91.229.2 (20 Nov 2006 19:23:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2006 19:23:33 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 20 20:23:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GmEjc-0001s8-Sy for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2006 20:23:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmEjc-0002fo-Bo for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2006 14:23:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GmEiv-0002JH-Cg for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:22:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GmEit-0002HN-On for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:22:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmEit-0002H9-DS for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:22:31 -0500 Original-Received: from [18.19.1.138] (helo=cyd.mit.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GmEit-0004VB-B9 for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:22:31 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 401DE4E44D; Mon, 20 Nov 2006 14:22:47 -0500 (EST) Original-To: Bob Rogers In-Reply-To: <17760.56196.739515.442009@rgrjr.dyndns.org> (Bob Rogers's message of "Sun\, 19 Nov 2006 17\:32\:36 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62571 Archived-At: Bob Rogers 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); }