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: Thu, 29 Mar 2012 20:47:09 +0200 Message-ID: <83r4wb1byq.fsf@gnu.org> References: <877hg5l828.fsf@escher.home> <8362vp9rci.fsf@gnu.org> <83y68l88xd.fsf@gnu.org> <87sjh12a0d.fsf@gnu.org> <871uolhmdx.fsf@escher.home> <83d381u9xy.fsf@gnu.org> <87limpoenv.fsf@escher.home> <83vclts5aq.fsf@gnu.org> <87pqc0bzyp.fsf@escher.home> <83mx70imgh.fsf@gnu.org> <874nt7hm9q.fsf@escher.home> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1333046808 26006 80.91.229.3 (29 Mar 2012 18:46:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2012 18:46:48 +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 Thu Mar 29 20:46:46 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 1SDKMw-0001er-7o for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 20:46:46 +0200 Original-Received: from localhost ([::1]:54019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKMv-0001e7-MP for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 14:46:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKMs-0001dU-0I for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:46:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDKMq-0000j1-4X for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:46:41 -0400 Original-Received: from [140.186.70.43] (port=38404 helo=debbugs.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKMq-0000hb-15 for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:46:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SDKrB-0003jZ-Ph for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 15:18: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: Thu, 29 Mar 2012 19:18: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.133304863914291 (code B ref 7464); Thu, 29 Mar 2012 19:18:01 +0000 Original-Received: (at 7464) by debbugs.gnu.org; 29 Mar 2012 19:17:19 +0000 Original-Received: from localhost ([127.0.0.1]:45236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDKqU-0003iR-HA for submit@debbugs.gnu.org; Thu, 29 Mar 2012 15:17:18 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:62744) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDKqR-0003iF-Cc for 7464@debbugs.gnu.org; Thu, 29 Mar 2012 15:17:16 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M1N00J00TE4Q900@a-mtaout22.012.net.il> for 7464@debbugs.gnu.org; Thu, 29 Mar 2012 20:45:06 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.231.234]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M1N00J2TTF51XI0@a-mtaout22.012.net.il>; Thu, 29 Mar 2012 20:45:06 +0200 (IST) In-reply-to: <874nt7hm9q.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:58292 Archived-At: > From: Stephen Berman > Cc: cyd@gnu.org, 7464@debbugs.gnu.org > Date: Thu, 29 Mar 2012 09:57:53 +0200 > > openSUSE's 23.3 has GTK scroll bars, while I built 23.4 like I build 24, > i.e., without toolkit scroll bars. So I rebuilt 23.4 with GTK scroll > bars, did the bug recipe and sure enough, now the mouse highlighting > remained, i.e., no bug. Then I disabled the scroll bars in that build, > tested again, and got the bug again. Then I rebuilt Emacs 24 with GTK > scroll bars, and now did not see the bug with them enabled but did see > it with them disabled. So the answers to my questions above appear to > involve the presence vs. absence of GTK scroll bars. (I guess Chong > Yidong also builds Emacs 24 with GTK scroll bars and tested the recipe > with them enabled, so that's why he did not observe the bug.) Unfortunately, I know almost nothing about how GTK in general and GTK scroll bars in particular are integrated into Emacs, and what, if anything, they change in how the Emacs display engine works. > After these tests, I ran both Emacs 24 builds (i.e., with and without > GTK scroll bars) under gdb, and in both cases, the value of > (w->current_matrix->rows+1)->mouse_face_p is 0 both at the breakpoint > and after the call to free_window_matrices (and of course after > adjust_glyphs). I also ran 23.4 under gdb, with the same result: > (w->current_matrix->rows+1)->mouse_face_p is already 0 before > adjust_glyphs. Do you have any idea why, or any further debugging > suggestions? The other piece of info I can share is how the mouse_face_p flag that is reset clears the mouse highlight. This happens in update_window_line: /* Update the display of the text area. */ if (update_text_area (w, vpos)) { changed_p = 1; if (current_row->mouse_face_p) *mouse_face_overwritten_p = 1; } ... /* Update current_row from desired_row. */ make_current (w->desired_matrix, w->current_matrix, vpos); And in make_current we see this: struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row); int mouse_face_p = current_row->mouse_face_p; /* Do current_row = desired_row. This exchanges glyph pointers between both rows, and does a structure assignment otherwise. */ assign_row (current_row, desired_row); /* Enable current_row to mark it as valid. */ current_row->enabled_p = 1; current_row->mouse_face_p = mouse_face_p; So if the mouse_face_p flag is reset in the current glyph matrix, it will be forcibly reset in the desired matrix, and also, the display-specific update_end_hook function will be called with mouse_face_overwritten_p arg set to zero, and will not redraw the mouse-highlighted characters: rif->update_window_end_hook (w, !paused_p, mouse_face_overwritten_p); Perhaps you could step through these functions and see what happens there with and without GTK scroll bars. To do so, put a breakpoint inside Fdelete_other_windows_internal, do the recipe, and when the breakpoint breaks, put a breakpoint in redisplay_internal and continue. When the breakpoint in redisplay_internal breaks, put a breakpoint in update_window, and step through the loop which updates the screen lines: /* Update the rest of the lines. */ for (; row < end && (force_p || !input_pending); ++row) This loop calls update_window_line: changed_p |= update_window_line (w, vpos, &mouse_face_overwritten_p); Does the mouse_face_overwritten_p flag return being set when the line with highlight is updated?