From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7464: 24.0.50; mouse highlighting vanishes upon unsplitting window Date: Sat, 24 Mar 2012 20:32:09 +0200 Message-ID: <83d381u9xy.fsf@gnu.org> References: <877hg5l828.fsf@escher.home> <8362vp9rci.fsf@gnu.org> <83y68l88xd.fsf@gnu.org> <87sjh12a0d.fsf@gnu.org> <871uolhmdx.fsf@escher.home> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1332614050 16259 80.91.229.3 (24 Mar 2012 18:34:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2012 18:34:10 +0000 (UTC) Cc: cyd@gnu.org, 7464@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 24 19:34:09 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBVmy-00059k-UH for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 19:34:09 +0100 Original-Received: from localhost ([::1]:54997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBVmy-0000pq-3n for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 14:34:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBVmu-0000p4-9q for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 14:34:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBVms-0008JG-DH for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 14:34:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBVms-0008JC-A4 for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 14:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBWGr-0007AR-Ja for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 15:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Mar 2012 19:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7464 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7464-submit@debbugs.gnu.org id=B7464.133261588127523 (code B ref 7464); Sat, 24 Mar 2012 19:05:01 +0000 Original-Received: (at 7464) by debbugs.gnu.org; 24 Mar 2012 19:04:41 +0000 Original-Received: from localhost ([127.0.0.1]:37191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBWGW-00079p-RK for submit@debbugs.gnu.org; Sat, 24 Mar 2012 15:04:41 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:37542) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBWG5-00078w-CX for 7464@debbugs.gnu.org; Sat, 24 Mar 2012 15:04:39 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M1E00K00JFSPS00@a-mtaout21.012.net.il> for 7464@debbugs.gnu.org; Sat, 24 Mar 2012 20:32:10 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.240.24]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M1E00KV2JHLKL90@a-mtaout21.012.net.il>; Sat, 24 Mar 2012 20:32:10 +0200 (IST) In-reply-to: <871uolhmdx.fsf@escher.home> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58097 Archived-At: > From: Stephen Berman > Cc: Eli Zaretskii , 7464@debbugs.gnu.org > Date: Wed, 21 Mar 2012 18:52:42 +0100 > > On Thu, 22 Mar 2012 00:29:06 +0800 Chong Yidong wrote: > > > Eli Zaretskii writes: > > > >>> > 1. emacs -q > >>> > 2. C-x 2 > >>> > 3. Put the mouse pointer over one of the links in the splash screen, so > >>> > that the link becomes highlighted. > >>> > 4. C-x 1 > >>> > => The highlighting from step 3 disappears > >>> > >>> > This problem is reliably reproducible, also on earlier builds of Emacs > >>> > 24 I have, but not on Emacs 23.1.91 (I don't have 23.2). > >>> > >>> I can reproduce it on Windows in Emacs 23.2.90 and also in stock Emacs > >>> 23.2 and Emacs 23.1. I don't have Emacs 23.1.90 anymore to test. > > > > I can't reproduce this with latest trunk (x86_64-unknown-linux-gnu, GTK+ > > Version 3.2.0). Maybe this has been fixed since the bug report? Eli, > > could you check again, since you could reproduce it before? > > I just updated from the trunk and rebuilt (GNU Emacs 24.0.94.6 > (i686-suse-linux-gnu, GTK+ Version 2.24.7) of 2012-03-21 on escher), and > I can still reproduce the bug. I found why this happens. The lines ("glyph rows") in which some of the glyphs are highlighted in mouse face are marked with a special flag. This flag is checked by redisplay, and it tells redisplay that when that row is redrawn, its mouse face should be restored. Now, "C-x 1" calls delete-other-windows-internal, which, as part of its job, deletes the glyph matrices of the original window. With that deletion, those flags of the highlighted rows are reset, i.e. the information about the highlight stored in the glyph matrix is lost. But no one tells redisplay that the mouse highlight was effectively overwritten, and that it should arrange for it to be redisplayed. The patch below fixes that. Again, since this isn't a regression wrt Emacs 23, I will not install it now unless Chong and Stefan decide I should. === modified file 'src/window.c' --- src/window.c 2012-03-12 06:34:32 +0000 +++ src/window.c 2012-03-24 18:19:24 +0000 @@ -2565,6 +2565,7 @@ window-start value is reasonable when th Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; EMACS_INT startpos IF_LINT (= 0); int top IF_LINT (= 0), new_top, resize_failed; + Mouse_HLInfo *hlinfo; w = decode_any_window (window); XSETWINDOW (window, w); @@ -2645,6 +2646,20 @@ window-start value is reasonable when th } BLOCK_INPUT; + hlinfo = MOUSE_HL_INFO (f); + /* We are going to free the glyph matrices of WINDOW, and with that + we might lose any information about glyph rows that have some of + their glyphs highlighted in mouse face. (These rows are marked + with a non-zero mouse_face_p flag.) If WINDOW indeed has some + glyphs highlighted in mouse face, signal to frame's up-to-date + hook that mouse highlight was overwritten, so that it will + arrange for redisplaying the highlight. */ + if (EQ (hlinfo->mouse_face_window, window)) + { + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + } free_window_matrices (r); windows_or_buffers_changed++;