From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50660: 28.0.50; Text artifacting when the cursor moves over text under mouse face that originally displayed a box Date: Tue, 21 Sep 2021 15:26:19 +0300 Message-ID: <83y27qxggk.fsf@gnu.org> References: <87czp6ysw7.fsf.ref@yahoo.com> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> <83ee9iz2tm.fsf@gnu.org> <87wnna1cu6.fsf@yahoo.com> <83bl4mz0yx.fsf@gnu.org> <83a6k6yzvr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23830"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 50660@debbugs.gnu.org To: luangruo@yahoo.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 21 14:27:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSerx-0005yQ-Al for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 14:27:29 +0200 Original-Received: from localhost ([::1]:48598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mServ-0002Q8-Lw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 08:27:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSerZ-0002Py-B5 for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 08:27:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSerW-0002CB-BU for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 08:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSerW-0007mC-3l for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 08:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Sep 2021 12:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50660 X-GNU-PR-Package: emacs Original-Received: via spool by 50660-submit@debbugs.gnu.org id=B50660.163222719829852 (code B ref 50660); Tue, 21 Sep 2021 12:27:02 +0000 Original-Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 12:26:38 +0000 Original-Received: from localhost ([127.0.0.1]:45169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSer7-0007lQ-VN for submit@debbugs.gnu.org; Tue, 21 Sep 2021 08:26:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSer6-0007lD-9m for 50660@debbugs.gnu.org; Tue, 21 Sep 2021 08:26:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47686) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSer0-00027V-Uy; Tue, 21 Sep 2021 08:26:30 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2256 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSeqw-0004Mp-CA; Tue, 21 Sep 2021 08:26:30 -0400 In-Reply-To: <83a6k6yzvr.fsf@gnu.org> (message from Eli Zaretskii on Tue, 21 Sep 2021 13:41:28 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214963 Archived-At: > Date: Tue, 21 Sep 2021 13:41:28 +0300 > From: Eli Zaretskii > Cc: luangruo@yahoo.com, larsi@gnus.org, 50660@debbugs.gnu.org > > Here's a specific idea: add the same code which fixes the cursor > position into gui_update_window_end, before display_and_set_cursor is > called, here: > > if (!w->pseudo_window_p) > { > block_input (); > > if (cursor_on_p) > display_and_set_cursor (w, true, > w->output_cursor.hpos, w->output_cursor.vpos, > w->output_cursor.x, w->output_cursor.y); > > if (draw_window_fringes (w, true)) > { > if (WINDOW_RIGHT_DIVIDER_WIDTH (w)) > gui_draw_right_divider (w); > else > gui_draw_vertical_border (w); > } > unblock_input (); > } > > This is always called when the display is updated, even if we just > move the cursor. By looking at the value of cursor_in_mouse_face_p, > we can determine whether the fix is needed, and apply it before > calling display_and_set_cursor. (We will need to fix w->phys_cursor.x > after the call to display_and_set_cursor returns, because it records > there the value passed as the 5th argument.) Actually, it looks like it would be enough to set mouse_face_overwritten_p = true in gui_update_window_end, when the cursor is inside mouse face highlighted text. Then, as the comments near the end of gui_update_window_end tell, this function already arranges for the mouse-highlight to be redisplayed, and that will call show_mouse_face.