GNU bug report logs - #50660
28.0.50; Text artifacting when the cursor moves over text under mouse face that originally displayed a box

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Po Lu <luangruo@HIDDEN>; dated Sat, 18 Sep 2021 12:24:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:27:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 08:27:53 2021
Received: from localhost ([127.0.0.1]:34912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mazpx-0008RW-4d
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:27:53 -0400
Received: from sonic312-23.consmr.mail.ne1.yahoo.com ([66.163.191.204]:45196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mazpu-0008RE-Op
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:27:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634214465; bh=zSZGM16DOcT8VUEZLbQYPJpQcUh0Ddgp63lIqYdBKeM=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=HIH6v0FyAkm5xB5UxcCBLqbWU22MHr3HjLNEN8d4+kQEv/95AqTHRBnwmjnruSpYeWuKqsneGKoZyZqO+64loirN5BK+g6Noj/HLtq9SQGa4cLaygvl7/JzO0r25xxbl5yEVJJthZvtrvj0WNRziBp64PSKdJYuOi935xGMii+H0PA1SDn7q9tfT5UhF4cZ6hg9rQex1XhT4anDqvRRzW6DbYJX9EEddUOh9nRV1NZ+6XJSMUDEGjFFiDnzP9by2gKq4Iv6RF55eB0q5Y875bFtVXep8hLX0GtBN6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QgcPyjH.t.5v1W2KLkE06ZYBnZYVK
 m5_t2T68jfMyropWOzJARGRsp_zdysxPE6NSWxW_SprCDziPrz5GYScFsPGa43Ws1mrkbSX_I.RU
 4wAukTIXWO0as2dhgWbu3rKkLdUAlhlqUEifhFUght5KRu6y5wC0lJ3t9hhgrWrcKDe5.auT4Eey
 WWMe0WSXqoDBJUg9BcmYLdWzzntf8Kisb82No.3wQ7upaehwu3R2rmlEiw9pRr8Wsn9ZMhtDRD6_
 hwSqrXo5UnQseDwz8N.OZDw4mzOVMMTQpHXEJC75TFJDNaHTqW3SjsGCqqgHkrUYna0xY3xkUJxM
 L6mWztbleVcN7HZUci82Bf_z56HMAnKPwOCgEMYxZvTjM2piMw1b7paY529UIxjTpyTj09BHa0gc
 xTQUrOr63TLYgK_hJDtpKDO9kGdbyD60_LK7uMKHPIT8A6p._9LXtyxWvIaJtaS_PFs8CO4L_Sy0
 NMKOndMx9lqYF4PeOHhV.dBaZErBSM2NjlQsbnofFiI0n56EOFg7u.DxOJ1U_i5x15W5JvcyurVm
 14Ibxy7oM1JvwCI0l6EyieKFyRhDfEtaVLzKWPacwSdndZtZ9eAMhW3yOapHO92Y56F8vwOp5FZ4
 jPv7nBPfM01qWRqx75t8A579w2wMjfRhz6QedBJAr3oPthgKgiasK22QRNzpT8YR15O7zI1kyTs7
 Z.7vXx9iqQHXsZUf1N1LeVXaRFis5hw9LecCyOk0ylQ4AHVyksK8ri8_4fFrL
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic312.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 12:27:45 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID e91f9d08f17f5b688742066845f22306; 
 Thu, 14 Oct 2021 12:27:37 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <83mtnbltyp.fsf@HIDDEN> <87mtnblt35.fsf@HIDDEN>
 <83ilxzlsck.fsf@HIDDEN> <877defls2w.fsf@HIDDEN>
 <83fst3lrwr.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 20:27:34 +0800
In-Reply-To: <83fst3lrwr.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 14 Oct
 2021 15:20:04 +0300")
Message-ID: <87o87rkczt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19116
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 868
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> If this affects the glyph string, then fill_XXX_glyph_string is a
> better place, yes.

Thanks, noted.

> I'm not sure what issue you have in mind.  Why should it matter if the
> glyph string's face is ASCII or non-ASCII?  Do you see any problems
> related to the box face that happen when text is ASCII, but not when
> it's non-ASCII, or vice versa?

IIUC, the face that is actually used in a glyph string is the one
returned by FACE_FOR_CHAR, which returns an adjusted face if the
character passed to it is multibyte.

What I'm asking is whether or not the adjustments made by FACE_FOR_CHAR
are also made to the mouse face (which I think they are not, because
there is only one mouse face at any given time, while the highlighted
area can span many faces that could have been adjusted for many
different characters).  Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:20:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 08:20:56 2021
Received: from localhost ([127.0.0.1]:34907 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mazjE-0008Fe-DA
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:20:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45294)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mazj9-0008FK-9w
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:20:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44572)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mazj0-0000uW-9Z; Thu, 14 Oct 2021 08:20:45 -0400
Received: from [87.69.77.57] (port=4825 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1maziR-0006r4-FZ; Thu, 14 Oct 2021 08:20:33 -0400
Date: Thu, 14 Oct 2021 15:20:04 +0300
Message-Id: <83fst3lrwr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <877defls2w.fsf@HIDDEN> (message from Po Lu on Thu, 14 Oct
 2021 20:16:23 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <83mtnbltyp.fsf@HIDDEN> <87mtnblt35.fsf@HIDDEN>
 <83ilxzlsck.fsf@HIDDEN> <877defls2w.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Thu, 14 Oct 2021 20:16:23 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > We may be miscommunicating.  My point is that the conditions on which
> > you base the face selection are known in draw_glyphs, so why delay
> > that to when xterm.c is called to actually draw the glyph string?  Why
> > not test this same condition in draw_glyphs (or some other suitable
> > place in xdisp.c) and fix the glyph string's face accordingly?  Am I
> > missing something?
> 
> OK, I think I understand what you mean now.  But is it really correct to
> put that in draw_glyphs, and not say, fill_XXX_glyph_string?

If this affects the glyph string, then fill_XXX_glyph_string is a
better place, yes.

> And even then, what about cases where a non-ASCII face is used?
> Does the mouse face in the Mouse_HLInfo take that into account?

I'm not sure what issue you have in mind.  Why should it matter if the
glyph string's face is ASCII or non-ASCII?  Do you see any problems
related to the box face that happen when text is ASCII, but not when
it's non-ASCII, or vice versa?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:16:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 08:16:43 2021
Received: from localhost ([127.0.0.1]:34890 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mazf9-000871-DI
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:16:43 -0400
Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:35312)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mazf7-00086l-2d
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:16:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634213795; bh=MFhHzA5yx6CrCazZKf0oGfXJVnhNApmu6yc1B96oSr4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=ZYT/AseyafT4v0B91T6tt/fHSy3NuYfDzeBebzGqqhOYCiK0Qm3skSL8DhSggdfuX0ukHRWucFM0Ntsl5AdFvXdtjVLV5EJd+jH9K5HMEcJT24EN+R0Ycr6LNW/yYo2ERVF47Jfe4ZtHa3HyeShfIoybzfbj23WSpsWtIKIrz/IIomIK1KMqymfmLSN6i6nFNJUAInJuRw2qdfFUslcc9ifVXzxHAgJqDLt4z5/ctMI8eUJYX5n1eUxzGXl584WNrV6tL9MUeTApE9rPLdPzMM+bV7yOaP8mVPYheaoSv8MbkDmxCeyL/3rqqgbYYLNYZ7jR2Vwn886VGFVwxocRcA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634213795; bh=vx543o/auaROmDPrQvYthAVCv07wwY7KldDOt4RK5ld=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=ReZdTEZ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EGc3LAwyV3g4Zz42j_P6EEVhQIpJ3KszJXiefg4i6yxGXWrnL2mLsKyfdcVjt7
 uj1cnHz4GzoFxtOfAim1FlzalAfquuK00wWOskOlir15YZkPgHy3SUpmsxKAR2MCYLPvtgIO71gK
 KaT_AAKPd5Mu3Ea90esPVjQsVpKA62aVjE5vrU6FeoPIJtuILVAgptOx1awcNTB0ALBtvT4UNEve
 Dx0p75raUT51ZBA8hwB17GVPCLhTOAvz8VClVmB_oETgGIQ93I22AM2ebLgasMwwcq6XFjGxIVIs
 ZpQn8_xM_Of0XA2TeJoqu0.P3n2xiGbNWkfxHsd2TsNTaQI1qqTZqUYnREVmjYN4MrK5PkjickuV
 Iof1LFOaq_S8.Z0a61H2KmWmaNvyf5q8q.7wnKMUQUHpViu5K_X90GUnnFgmWRh74tn9irZKgFkR
 8uuMwDHR_Ry2SUWC5oi_.uHr90Gx7s7viw3giVSyhWom8m8OZrNIi3yZguRZsB75nH5ZeHJIwpA4
 kw5cfYzEUeX2YCtdXws9HblHnY9fLi.7jVMvDT5hfCGQuLf4aViZmYPBePg--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic316.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 12:16:35 +0000
Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 5e81773652ecce665d19852c9304543a; 
 Thu, 14 Oct 2021 12:16:29 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <83mtnbltyp.fsf@HIDDEN> <87mtnblt35.fsf@HIDDEN>
 <83ilxzlsck.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 20:16:23 +0800
In-Reply-To: <83ilxzlsck.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 14 Oct
 2021 15:10:35 +0300")
Message-ID: <877defls2w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19116
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 688
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> We may be miscommunicating.  My point is that the conditions on which
> you base the face selection are known in draw_glyphs, so why delay
> that to when xterm.c is called to actually draw the glyph string?  Why
> not test this same condition in draw_glyphs (or some other suitable
> place in xdisp.c) and fix the glyph string's face accordingly?  Am I
> missing something?

OK, I think I understand what you mean now.  But is it really correct to
put that in draw_glyphs, and not say, fill_XXX_glyph_string?  And even
then, what about cases where a non-ASCII face is used?  Does the mouse
face in the Mouse_HLInfo take that into account?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:10:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 08:10:54 2021
Received: from localhost ([127.0.0.1]:34877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mazZW-0007wB-2k
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:10:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mazZS-0007vw-Qe
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 08:10:52 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43798)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mazZN-0006Tc-1Y; Thu, 14 Oct 2021 08:10:45 -0400
Received: from [87.69.77.57] (port=4239 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mazZF-0005Sf-TB; Thu, 14 Oct 2021 08:10:44 -0400
Date: Thu, 14 Oct 2021 15:10:35 +0300
Message-Id: <83ilxzlsck.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87mtnblt35.fsf@HIDDEN> (message from Po Lu on Thu, 14 Oct
 2021 19:54:38 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <83mtnbltyp.fsf@HIDDEN> <87mtnblt35.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Thu, 14 Oct 2021 19:54:38 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> @@ -1799,11 +1799,24 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
> >>  {
> >>    int i, x;
> >>  
> >> +  struct face *face_for_box_line = s->face;
> >> +
> >> +  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
> >> +    {
> >> +      /* In this situation, the cursor is in the mouse face, but
> >> +	 s->face hasn't been updated with the mouse face yet. */
> >> +      face_for_box_line =
> >> +	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
> >> +
> >> +      if (!face_for_box_line)
> >> +	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
> >> +    }
> 
> > Can't we "fix" this face in xdisp.c, before calling the
> > terminal-specific backend?  The bonus will be that we then do it only
> > in one place.
> 
> The only way to do that I can think of would be to offset the glyph
> string's x position (but not the phys cursor) by the vertical box line
> width, and I think it would be an ugly thing to do, because that would
> imply lying to the window system backend.

We may be miscommunicating.  My point is that the conditions on which
you base the face selection are known in draw_glyphs, so why delay
that to when xterm.c is called to actually draw the glyph string?  Why
not test this same condition in draw_glyphs (or some other suitable
place in xdisp.c) and fix the glyph string's face accordingly?  Am I
missing something?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:54:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 07:54:56 2021
Received: from localhost ([127.0.0.1]:34843 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mazK4-0007XJ-DP
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:54:56 -0400
Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:33605)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mazK0-0007X4-8U
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:54:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634212486; bh=FtYLHrSd1LgFdW+URPYwtFTgASkVu7vve7CkLkn1Kl0=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=WPaECOB30CvLQWHaz1S59QGGHutnfQdEgBdpQbuIp9zQl54FcAGlLm1B+fB5HO1CSpUAFTtmQkNqt/GAvgmBUy/E6avt+9YUOpnh7SyGDyiVN+QYpS+AKqKOpkvjuLa5cMRcX4u2zjEAEm3iPQfOsmr++SXkyCIIH2zsLdnZSHSLtFud65rvkEHgsa5zplx/zqbCBcakwc9xKbLftQy/pMFRCHmN3uGdTiK3rpG//STPkO3WNr3+xOyMOn5LgL2QXXNwUVT3t484sCl1Pw3oz75BwZORzbgs5pc4giiC/xsK8Bzgm05ls8d01n6kM/9hunemKwABoza0g5877StWxA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634212486; bh=Xh1ThV6S/XXJa4PXbuAapdUFHmi+NQ9oX71zLEUu/YW=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=L01Bmly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VhiWDvu0qcCXrVpXL_M0tDMeGgPZGHc6SxsFbPY
 CbuQpPwLPtEKQmxfYau1Ka4Stp6gX5DlJ.q3q0GcNFtYUQxizzzYMZp5HvGWouKhzOzCV4Ec9Zuh
 soSWDvLmvSTrumaGzTq33AA2oLNOWb369WbCqqP5YbEpDyA3ObtSmbtL2al3r.sE14LZZvvJ2MfY
 Uuo0ilr1BJQDXJZ1AzH2wb7C4W1pDWG.jnaeK4O9ljUlevjJDCP.ytMs9qnJ73Gau1JYLfbvvr9B
 vM1AZcfjJ5xSW_i7AWWP4iOlq6rNoXcLdh2vvKO0.OuWYzsXTNPEPrB_33vUt7b.vxxBEVmQjU_N
 mu4DA64_e6s.pI06lfXeA4vmajOztE2_y09FXCzD1SYcr.okzR6gSDzBck09BHgtEAc684FueQtI
 M8joaWA892XZmbmF.TDx1hrHcwxw9u9Lw0USdEgKmVcvMHttquBI9Y2RQViyp29yTprGC_84waHO
 fx6OMmmFC8ivm.7K58HMnzGyW6CwuKLR_SsU0fI.W3.FWreeFnzdg4RfxZg--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic306.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 11:54:46 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 7c5c3322412d81437f539e1238bc6229; 
 Thu, 14 Oct 2021 11:54:42 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <83mtnbltyp.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 19:54:38 +0800
In-Reply-To: <83mtnbltyp.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 14 Oct
 2021 14:35:42 +0300")
Message-ID: <87mtnblt35.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19116
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1023
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> @@ -1799,11 +1799,24 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
>>  {
>>    int i, x;
>>  
>> +  struct face *face_for_box_line = s->face;
>> +
>> +  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
>> +    {
>> +      /* In this situation, the cursor is in the mouse face, but
>> +	 s->face hasn't been updated with the mouse face yet. */
>> +      face_for_box_line =
>> +	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
>> +
>> +      if (!face_for_box_line)
>> +	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
>> +    }

> Can't we "fix" this face in xdisp.c, before calling the
> terminal-specific backend?  The bonus will be that we then do it only
> in one place.

The only way to do that I can think of would be to offset the glyph
string's x position (but not the phys cursor) by the vertical box line
width, and I think it would be an ugly thing to do, because that would
imply lying to the window system backend.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:36:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 07:36:10 2021
Received: from localhost ([127.0.0.1]:34838 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maz1t-00074f-Oa
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:36:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34840)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1maz1p-000745-Cn
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:36:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43070)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1maz1k-0005si-12; Thu, 14 Oct 2021 07:36:00 -0400
Received: from [87.69.77.57] (port=1987 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1maz1T-0007eD-TI; Thu, 14 Oct 2021 07:35:59 -0400
Date: Thu, 14 Oct 2021 14:35:42 +0300
Message-Id: <83mtnbltyp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <878ryvnain.fsf@HIDDEN> (message from Po Lu on Thu, 14 Oct
 2021 18:52:48 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Thu, 14 Oct 2021 18:52:48 +0800
> 
> I don't know how to apply the fixes to xterm.c to the other window
> systems, so someone who can needs to apply them to the NS and MS-Windows
> ports.

You just make the same changes there, and ask people with access to
those other systems to test it.  But see below.

> @@ -1799,11 +1799,24 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
>  {
>    int i, x;
>  
> +  struct face *face_for_box_line = s->face;
> +
> +  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
> +    {
> +      /* In this situation, the cursor is in the mouse face, but
> +	 s->face hasn't been updated with the mouse face yet. */
> +      face_for_box_line =
> +	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
> +
> +      if (!face_for_box_line)
> +	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
> +    }

Can't we "fix" this face in xdisp.c, before calling the
terminal-specific backend?  The bonus will be that we then do it only
in one place.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:26:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 07:26:10 2021
Received: from localhost ([127.0.0.1]:34831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maysD-0004fR-RT
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:26:10 -0400
Received: from sonic313-56.consmr.mail.ne1.yahoo.com ([66.163.185.31]:44452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mays9-0004es-Gb
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:26:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634210760; bh=lSVN71ldcDLuX66cZ4AeijLp9yqUHSVfhZaPSWE/Ww4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=m225dWGMh/tZdo1SKMfJ9GA5QhxQY/CyyuKVP7eMoG4XsnmdziYknE1Lb/pYwP1++mFoivGSl5MwzpU7FqaigWtXSIckQaKemvnDraEKLlrzItLi8SfI/w/4TfF33SnTQlUKLZZJc26zo3MBOgX4BEbCSHffjDKfGSQU2xqp2dQSAhw1AjIOima55+L5D6GWY6sRTE30TGQqCQ9kDST4YgGSdgGMYMhDNFBVhEgUtWYOfjeQIFy9CE9VVMt871Hm9MkEqCIBKF+EAjBP6BMcQK7SO1+ua3MRo5VBZd8/RqP2vasi51gqzyc3uNbjZzx4EJyGGG0Bkk3F83rNMWC06A==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634210760; bh=8XSlZ4Im8IPewQEVNiqHFni8M5R7ZmsHXlkkV2fol11=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
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zih0lY47gfmSLAes038RNRvdmpxaMlGtHH7ldVULsr995ToA9EN0hudxImMLgUIpg4gUPVHU
 tC.A..sBk_6p2hQUDhaCxGR66OdyeQX4AelOzWToduDNx8VDitye.QJJ0l23MPT7ud3M9PtrqFQR
 hi94mbRA4yAPAm6n66z3PRHJ2Fq5tyto28EXp7hT2MLHUxufkuAaVihKnyiayZ8X.in1wjNhFzMF
 PXM035CPBydlRmqczE7cksOtpvkV1MqseW6UAjRhXAuHd4fHg25xao5BDKFvybvqWv9Rcz1GzHVI
 NsFzXwK3zBHBgISh0qevwxFib1O4ZcCgtoB.c9rHDaPFeH602b0zKF.WzV8.fX6iSmAO4RKP9scE
 dyzruIc1KyiV1Nc9AbvhLlkZYmK0utsLN4z8z_J5xP9Ym8MUti1kqHz38D5PcE85Wk2CWnWPFoU5
 lULyavqikXf2mYPFgWd1.SDDx05bG8mLduAu437j3D8fbPCwOZErk4ZVnyRzg_vOY.V_pSox.tUE
 QbleoyOz.aA9T.ItTb050GJsV6ZkJKcqH0BrwhC3gSjgFvQfcljuIR.V3hj4-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic313.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 11:26:00 +0000
Received: by kubenode517.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID d121bca40d8f8900ef581f0fb5d6d0e5; 
 Thu, 14 Oct 2021 11:25:55 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN> <878ryvnain.fsf@HIDDEN>
 <87lf2v7te4.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 19:25:51 +0800
In-Reply-To: <87lf2v7te4.fsf@HIDDEN> (Robert Pluim's message of "Thu, 14
 Oct 2021 13:11:47 +0200")
Message-ID: <87sfx3luf4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.19116
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 912
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Robert Pluim <rpluim@HIDDEN> writes:

>     Po Lu> +  struct face *face_for_box_line =3D s->face;
>     Po Lu> +
>     Po Lu> +  if (s->hl =3D=3D DRAW_CURSOR && cursor_in_mouse_face_p (s->=
w))
>     Po Lu> +    {
>     Po Lu> +      /* In this situation, the cursor is in the mouse face, =
but
>     Po Lu> +	 s->face hasn't been updated with the mouse face yet. */
>     Po Lu> +      face_for_box_line =3D
>     Po Lu> +	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face=
_face_id);
>     Po Lu> +
>     Po Lu> +      if (!face_for_box_line)
>     Po Lu> +	face_for_box_line =3D FACE_FROM_ID (s->f, MOUSE_FACE_ID);
>     Po Lu> +    }
>
> This chunk looks like it=CA=BCs repeated a lot, perhaps break it out into=
 a
> function?

Actually, on second thought, I think a better solution would be to set
s->face to the mouse face in x_set_cursor_gc if cursor_in_mouse_face_p.

Any thoughts?  TIA.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:12:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 07:12:00 2021
Received: from localhost ([127.0.0.1]:34799 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mayeW-0004J2-Mn
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:12:00 -0400
Received: from mail-wr1-f44.google.com ([209.85.221.44]:46027)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1mayeR-0004Ik-7G
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 07:11:59 -0400
Received: by mail-wr1-f44.google.com with SMTP id r10so18157265wra.12
 for <50660 <at> debbugs.gnu.org>; Thu, 14 Oct 2021 04:11:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=gKWjLXfPLKPaecBc1bUzKiAKdhAxXa1664XoCFzJJOk=;
 b=Z8qBpyFF3SNJqXk/tM6XeaLfPJ4OiiiwZjcbniVM8Pt9jaC9jmqsxEpN/3QEI1IgqK
 T5MK/iQ+cdjKMarU7iH4qntubqYg1dK+2zOuM2X2CnQb+e7EcwT9YwwFK8DcwkEtFg3m
 g5vt/fikYQxTvjcX4W5AHcf/a9YBervqjQ2A9s7qD0jQrW8wt7YwIWmCZNaAxUj0XxU7
 NomkBnkfGlyyEQB1cQstgXQgSNMlmz4I2LcsHJTJA8hp8VmQiO+kdXN4Cm/34t/dESV3
 mwAisyYXUp9Mo0sdpzWME6vXKWwlObnh/3HTloYHk9KZW2Zbhd+xfEDzxZ1ggDFquAVe
 AWsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=gKWjLXfPLKPaecBc1bUzKiAKdhAxXa1664XoCFzJJOk=;
 b=AD4M5ERD7Z8Y3QKL1a/C7GKwpGX9cW+l+3ude821J57m1J4kHoh0fwieD4Q5Owx9D5
 J+fT4QBEODSGoEZo2U+8eU01i0OeDFuJOJJUxQxTFfesMWbC/oWQwQBZoUtl0K8xiwf+
 ZmYIfrMaxH9ZdAstC3yCvJvUNh/+p/SXOjDnKBk6s2y3cqBaThG0vEbNzWmCC5i7H6TE
 cN+i1mU/xUtV7IGQe+jxjfeKo50gmcfWhY3l6ORZLnING7mxDKVW5Ui3fmlpMFwxGVH3
 kTSk0arCXdJH6mL8143FRfe3uF3U5xT4G7dDAabgrkHbs/9dusG41WeG2fUPJ/S2v39u
 bhtw==
X-Gm-Message-State: AOAM5303i2WE4mnuCcPk6nmBRAAR6BRKT7q3ZqZ9oAWSi5vK199vZfaR
 Ks92ng6LWXalUj3Ry4ubhblI5KyFw0s=
X-Google-Smtp-Source: ABdhPJzOdIhusnst40L1T1El9oIpqAM9SDU5QDm6tGVI3bGqxlsxacsmcuFE59RzlsHg4AXrPgcMxg==
X-Received: by 2002:a05:600c:3584:: with SMTP id
 p4mr18321879wmq.168.1634209909038; 
 Thu, 14 Oct 2021 04:11:49 -0700 (PDT)
Received: from rltb ([82.66.8.55])
 by smtp.gmail.com with ESMTPSA id n7sm2073044wra.37.2021.10.14.04.11.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 14 Oct 2021 04:11:48 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
 <83pmt2xcox.fsf@HIDDEN> <87lf3myhlb.fsf@HIDDEN>
 <87a6jzvnpq.fsf@HIDDEN> <83o88fom1k.fsf@HIDDEN>
 <871r5bvex8.fsf@HIDDEN> <83v92mkzft.fsf@HIDDEN>
 <87k0j0rwo3.fsf@HIDDEN> <838rzbddfa.fsf@HIDDEN>
 <878rzbd1w5.fsf@HIDDEN> <83wnmgkmok.fsf@HIDDEN>
 <878ryvnain.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 13:11:47 +0200
In-Reply-To: <878ryvnain.fsf@HIDDEN> (Po Lu via's message of "Thu, 14 Oct
 2021 18:52:48 +0800")
Message-ID: <87lf2v7te4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Thu, 14 Oct 2021 18:52:48 +0800, Po Lu via "Bug reports for GNU Em=
acs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> said:

    Po Lu> +  struct face *face_for_box_line =3D s->face;
    Po Lu> +
    Po Lu> +  if (s->hl =3D=3D DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
    Po Lu> +    {
    Po Lu> +      /* In this situation, the cursor is in the mouse face, but
    Po Lu> +	 s->face hasn't been updated with the mouse face yet. */
    Po Lu> +      face_for_box_line =3D
    Po Lu> +	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_f=
ace_id);
    Po Lu> +
    Po Lu> +      if (!face_for_box_line)
    Po Lu> +	face_for_box_line =3D FACE_FROM_ID (s->f, MOUSE_FACE_ID);
    Po Lu> +    }

This chunk looks like it=CA=BCs repeated a lot, perhaps break it out into a
function?

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 10:53:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 06:53:04 2021
Received: from localhost ([127.0.0.1]:34742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mayMC-0003pC-88
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 06:53:04 -0400
Received: from sonic304-20.consmr.mail.ne1.yahoo.com ([66.163.191.146]:46443)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mayM9-0003oh-Ty
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 06:53:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1634208776; bh=QV2LLEVfjUrWtfpu2VywMaoafDHhlIwBbFewiuTkfXA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=SFNDyIyKE9XL8Cj8kNDLQgv9tlSJq1aHb3NE0Mci41xWPaBNZDPDbl3I+mq7YcT38SCDVoxWddwP6mjLNeV8Tg2iV9+UNCBvBBv5tXXtbjGf7s2a3fiEtFjeX2Jqio/ko2K5LTad2gEUNz57pauOHU55CZqceoN/lFxedmxvHHih92G7jwF6A789GdLPIqplvC0DScH+umRl2lV+vNVNratsottQjgt6szxgAfb9ghg9HSQblf0+VwzSAq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I7hmYNWt_g7XdIyjJtcl8Fb
 svXCm6qdUcCo7_d5uOnKFXwTwddEg7tM5FZyjQdtQ6KMbO91IK8u9Yql0xbRhUe66edr6GJVLLWq
 Y.KQKhR7UzUPEbfjHcrJerzC0zVTuLlGjO13b.L_bTLxPyCCM4JtUN3MwD50oKCFWKIHFrygK8Bc
 Ei0ZPi3_CO_KM_3xancNkNRZmKEEylL.Q3KxvfDjkzDVtUa6NHGQMyEyGy1PsAU9HnVlF4aJOD2d
 Nnzf.f1eSEahZ_5zJASOx5hOpVD.bjIRBkX7FLBwW.HYuI_kkORg5YCvGXnEvyOrXe.5gyynvoJw
 cBAREReXJ29nnYh_FYo7ZaJAlGFAQFDETevYWl6idTGC0hgMPDrCWp5vi662rIVedua4ZE8UhWrE
 6yF1PaZWvqaEmWH3BWRWVHQyEKh0jdMlIIBQRbc0oUJrencfRMoGpMDSNam9K8RxZItDWxidmHqA
 nmqqG8yR2FaCjuWNmBGHL4EIAI4PokP0W8lwu.PtRTXf69mWf9t2f0XIhfkhCgvuksM5Usqa9wTA
 _rSNxXVvI7MrGLgFXaZmVOsHh8Vl3CRmd7Ff_qNhw3aZnqkn0mjmlsqt6tUFn4jWZ_0t4I8WnJSj
 yA_t7x24I0._7mWB_IF2FnZ.IZyksxI6vPXETJBS0VCdr1JMeGGLxSld8mvN3oDqV.gJhkTWu_Vx
 Q8MG6u2iISshFqNdiuDA0VXGPdPeBwqoKTpN6TYyaeH2nJs4LSCD4o4JA5YFnsuDYHokLPzT7VI5
 2gjziuexsh6qzeH13JaDRSlhfu1kaELRn31xGcOGyt_Yesi0VT49L
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic304.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 10:52:56 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID d78cd6ddf5ec180f5513d04446c23506; 
 Thu, 14 Oct 2021 10:52:51 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
 <83wnmgkmok.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 18:52:48 +0800
In-Reply-To: <83wnmgkmok.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 14 Oct
 2021 11:58:19 +0300")
Message-ID: <878ryvnain.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19116
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 8819
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

> It looks like something is still amiss: the cursor blinking display is
> incorrect in some cases.  For example, evaluate this in a buffer under
> Fundamental mode:
>
>   (insert (propertize "some sample text" 'face '(:box 10) 'mouse-face 'highlight))
>
> and then put the mouse pointer above the text, so it's highlighted,
> and move the text cursor to the first 's' or the last 't'.  As long as
> the cursor blinks, you will see two characters drawn in the cursor
> face, not one as expected.

Thanks, here's a patch that should fix the issues, formatted with "git
format-patch", but with one caveat: in your example above, the
background of the character "s" at the beginning of the string "some
sample text" is drawn too wide, but I wasn't able to find the problem.

Could you please take a look at it?  Thanks.

I don't know how to apply the fixes to xterm.c to the other window
systems, so someone who can needs to apply them to the NS and MS-Windows
ports.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Fix-minor-issues-with-text-display-when-cursor-is-in.patch

From 6d277be789bf30e0db5b27780bff86151e48f622 Mon Sep 17 00:00:00 2001
From: oldosfan <luangruo@HIDDEN>
Date: Thu, 14 Oct 2021 18:38:26 +0800
Subject: [PATCH] Fix minor issues with text display when cursor is in mouse
 face

 * src/xdisp.c (get_cursor_offset_for_mouse_face): Don't calculate
offsets for the glyph the cursor is on.

 * src/xterm.c (x_draw_glyph_string_foreground,
x_draw_composite_glyph_string_foreground,
x_draw_glyphless_glyph_string_foreground,
x_draw_image_foreground,
x_draw_image_foreground_1): Take mouse face into account when
offsetting X coordinate by the vertical line width.
---
 src/xdisp.c |   2 +-
 src/xterm.c | 107 ++++++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 93 insertions(+), 16 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 012c2ad8bf..0d964b1236 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -36042,7 +36042,7 @@ get_cursor_offset_for_mouse_face (struct window *w, struct glyph_row *row,
   /* Calculate the offset to correct phys_cursor x if we are
      drawing the cursor inside mouse-face highlighted text.  */
 
-  for (; row->reversed_p ? start >= end : start <= end;
+  for (; row->reversed_p ? start > end : start < end;
        row->reversed_p ? --start : ++start)
     {
       struct glyph *g = start;
diff --git a/src/xterm.c b/src/xterm.c
index 89885e0d88..d19f214019 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1799,11 +1799,24 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
 {
   int i, x;
 
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+
   /* If first glyph of S has a left box line, start drawing the text
      of S to the right of that box line.  */
-  if (s->face->box != FACE_NO_BOX
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p)
-    x = s->x + max (s->face->box_vertical_line_width, 0);
+    x = s->x + max (face_for_box_line->box_vertical_line_width, 0);
   else
     x = s->x;
 
@@ -1893,11 +1906,24 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s)
   int i, j, x;
   struct font *font = s->font;
 
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+
   /* If first glyph of S has a left box line, start drawing the text
      of S to the right of that box line.  */
-  if (s->face && s->face->box != FACE_NO_BOX
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p)
-    x = s->x + max (s->face->box_vertical_line_width, 0);
+    x = s->x + max (face_for_box_line->box_vertical_line_width, 0);
   else
     x = s->x;
 
@@ -2004,11 +2030,24 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
   unsigned char2b[8];
   int x, i, j;
 
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+
   /* If first glyph of S has a left box line, start drawing the text
      of S to the right of that box line.  */
-  if (s->face && s->face->box != FACE_NO_BOX
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p)
-    x = s->x + max (s->face->box_vertical_line_width, 0);
+    x = s->x + max (face_for_box_line->box_vertical_line_width, 0);
   else
     x = s->x;
 
@@ -3073,12 +3112,25 @@ x_draw_image_foreground (struct glyph_string *s)
   int x = s->x;
   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
 
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+
   /* If first glyph of S has a left box line, start drawing it to the
-     right of that line.  */
-  if (s->face->box != FACE_NO_BOX
+     right of that box line.  */
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p
       && s->slice.x == 0)
-    x += max (s->face->box_vertical_line_width, 0);
+    x += max (face_for_box_line->box_vertical_line_width, 0);
 
   /* If there is a margin around the image, adjust x- and y-position
      by that margin.  */
@@ -3191,13 +3243,25 @@ x_draw_image_relief (struct glyph_string *s)
   XRectangle r;
   int x = s->x;
   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
 
   /* If first glyph of S has a left box line, start drawing it to the
-     right of that line.  */
-  if (s->face->box != FACE_NO_BOX
+     right of that box line.  */
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p
       && s->slice.x == 0)
-    x += max (s->face->box_vertical_line_width, 0);
+    x += max (face_for_box_line->box_vertical_line_width, 0);
 
   /* If there is a margin around the image, adjust x- and y-position
      by that margin.  */
@@ -3282,12 +3346,25 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap)
   int x = 0;
   int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
 
+  struct face *face_for_box_line = s->face;
+
+  if (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))
+    {
+      /* In this situation, the cursor is in the mouse face, but
+	 s->face hasn't been updated with the mouse face yet. */
+      face_for_box_line =
+	FACE_FROM_ID_OR_NULL (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
+
+      if (!face_for_box_line)
+	face_for_box_line = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+    }
+
   /* If first glyph of S has a left box line, start drawing it to the
-     right of that line.  */
-  if (s->face->box != FACE_NO_BOX
+     right of that box line.  */
+  if (face_for_box_line->box != FACE_NO_BOX
       && s->first_glyph->left_box_line_p
       && s->slice.x == 0)
-    x += max (s->face->box_vertical_line_width, 0);
+    x += max (face_for_box_line->box_vertical_line_width, 0);
 
   /* If there is a margin around the image, adjust x- and y-position
      by that margin.  */
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 08:58:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 04:58:34 2021
Received: from localhost ([127.0.0.1]:34631 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mawZN-0000oe-NA
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 04:58:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52132)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mawZJ-0000oP-O4
 for 50660 <at> debbugs.gnu.org; Thu, 14 Oct 2021 04:58:32 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39592)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mawZD-0002pT-IC; Thu, 14 Oct 2021 04:58:24 -0400
Received: from [87.69.77.57] (port=4119 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mawZD-0006nB-5B; Thu, 14 Oct 2021 04:58:23 -0400
Date: Thu, 14 Oct 2021 11:58:19 +0300
Message-Id: <83wnmgkmok.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <878rzbd1w5.fsf@HIDDEN> (message from Po Lu on Sat, 02 Oct
 2021 20:52:58 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN> <878rzbd1w5.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Sat, 02 Oct 2021 20:52:58 +0800
> 
> Thanks for the comments, I'm attaching a rectified patch.

Thanks, I installed this on the master branch with a few minor
stylistic fixes.  In the future, please try posting a patch formatted
with "git format-patch", or at least accompany the patch with a
ChangeLog-style commit log entry.  (I wrote the log message for you
this time.)

It looks like something is still amiss: the cursor blinking display is
incorrect in some cases.  For example, evaluate this in a buffer under
Fundamental mode:

  (insert (propertize "some sample text" 'face '(:box 10) 'mouse-face 'highlight))

and then put the mouse pointer above the text, so it's highlighted,
and move the text cursor to the first 's' or the last 't'.  As long as
the cursor blinks, you will see two characters drawn in the cursor
face, not one as expected.

Also, in your original recipe with list-faces-display, if the text
cursor is at the first character of the "abcdefg..." text of a line
with mode-line-highlight face, moving the mouse pointer to and from
the text, thus intermittently highlighting and de-highlighting it,
leaves artifacts of the 'a' character on display.

So I'm not closing this bug yet, as some work still needs to be
invested to clean up those minor remaining issues.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 12:53:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 08:53:14 2021
Received: from localhost ([127.0.0.1]:58185 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWeVu-0001Q8-6R
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 08:53:14 -0400
Received: from sonic302-21.consmr.mail.ne1.yahoo.com ([66.163.186.147]:44463)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mWeVs-0001Pv-La
 for 50660 <at> debbugs.gnu.org; Sat, 02 Oct 2021 08:53:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1633179186; bh=UUneFM/0tX1rThJv4a22qJYttOyH9mwk8jpzK4UW41Q=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=oVbcZHtij9ZJLBvqQojK9NKfZn6kX/+bL6UXYUnHCpfJi4rEsCvYwuYXlTAZ6Ii3NUFHPMS8mewMIr8Kp5yWgptMJMzTegPvRaeMkliZn/ZLt9XK82MfwgMG+faZOcbhdcJyrbHRh9QH3ih6pmxfg2RfWQtFBLFQkaIbnFZoUNLYcz2mAk0D/SfN7iYDVh1r95cfjjUkHP9LOj7tngToNA1IWeJMiwshs2nNvkHQqz8y58dEyAjmfmT2m7g3Iwz+Pl/QhYt8YoP29XOfnSoAsJ/ttSAcNSR/BOqCfAGnBpJbW7u1Yn9OiveRRHoG8PqA5rsQ2cCDEmah86885of7UA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1633179186; bh=YikpR1nE9ouZJODsO1KZS286CYB3d8r73ciWxerat0g=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=P5SahmDT3YX6TEV0Wzgdkh157+dnUN3nU/3y5yjLYxekUk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CG9mJMcySxr4noKeFZ9
 q7_HKBmVrKB2KfFAt2rxEhW1pedWQ7ETSONAqTZ8UO.RQ6DRvSF5uIrKYlKLDDzFwjS2d28UdayY
 nFPwO56n1yAVzUFNSKRvlRe8PX5CMXU7rP3MEUzi4obm38bKPtYr7xpTp86Vwk3fg7fF.ThWZCjk
 .MfBaowOoCpTyiB_RJDJUzIOaEtxydj9isWubNNUiZaowQDvZtMTpY3Pqw8hH3_9kJhWxtZzILcj
 SSo3KyRtPGW1JFkeBcawD3Q_mp0dIBkfNlfd17FJslIr9xaPyQ1BGCJYpwrOh8HbjbpDyRBedAqA
 Na9noNaRtYP9CKFWJG5EC7ZJRwEVLeRqNWh9o2hs58F65G_thkYQP2HsOcmYcjU9YvQm9Vsy__oB
 DZ.jCoHLuwgJ5EIl9qg.XPYvUOMT0i7jAlUJ3P3HHGUOKxZl5i0FGSzHGxXOMVNu6d85PaAuaRdx
 6QhLckRCylJ4t98c9O7dbVXr8KyvlbbhmdyHJ7gZKVyYMmEfPt12zYDaVbuceteSjMknUB.PJH5m
 9UCOrH_rSg7SOoFdzKA--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic302.consmr.mail.ne1.yahoo.com with HTTP; Sat, 2 Oct 2021 12:53:06 +0000
Received: by kubenode518.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID c1da78d18a9b8de9fb1294d5befa1c23; 
 Sat, 02 Oct 2021 12:53:02 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN>
Date: Sat, 02 Oct 2021 20:52:58 +0800
In-Reply-To: <838rzbddfa.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 02 Oct
 2021 11:43:53 +0300")
Message-ID: <878rzbd1w5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19076
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 8798
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

Thanks for the comments, I'm attaching a rectified patch.

I think the rest of what you've brought up has been resolved by the new
patch, but I would like to clarify something here:

> There's no reason to use -= and += here.  The callers never initialize
> the argument to anything but zero, nor should they.  This function
> _calculates_ the offset, it doesn't _correct_ it.  So a simple
> assignment should do better, because using the above begs the
> question: what could the initial value be?  The callers should add or
> subtract the corrections as they see fit.

I changed the function to use an internal accumulator variable
initialized to 0.  The -= and += is still necessary, as we are inside a
loop which can potentially go through many glyphs that are relevant.

Thanks.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-cursor-position.patch

diff --git a/src/dispnew.c b/src/dispnew.c
index 0c31319917..62f7074dcd 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3848,6 +3848,9 @@ gui_update_window_end (struct window *w, bool cursor_on_p,
 				w->output_cursor.hpos, w->output_cursor.vpos,
 				w->output_cursor.x, w->output_cursor.y);
 
+      if (cursor_in_mouse_face_p (w) && cursor_on_p)
+	mouse_face_overwritten_p = 1;
+
       if (draw_window_fringes (w, true))
 	{
 	  if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
diff --git a/src/xdisp.c b/src/xdisp.c
index 2e72f6b591..f2b4e43592 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1179,7 +1179,9 @@ #define face_after_it_pos(IT)  face_before_or_after_it_pos (IT, false)
 static Lisp_Object get_it_property (struct it *, Lisp_Object);
 static Lisp_Object calc_line_height_property (struct it *, Lisp_Object,
 					      struct font *, int, bool);
-
+static void get_cursor_offset_for_mouse_face (struct window *w,
+					      struct glyph_row *row,
+					      int *offset);
 #endif /* HAVE_WINDOW_SYSTEM */
 
 static void produce_special_glyphs (struct it *, enum display_element_type);
@@ -29509,6 +29511,8 @@ produce_image_glyph (struct it *it)
 
   if (face->box != FACE_NO_BOX)
     {
+      /* If you change the logic here, please change it in
+	 get_cursor_offset_for_mouse_face as well. */
       if (face->box_horizontal_line_width > 0)
 	{
 	  if (slice.y == 0)
@@ -31741,6 +31745,10 @@ erase_phys_cursor (struct window *w)
   Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
   int hpos = w->phys_cursor.hpos;
   int vpos = w->phys_cursor.vpos;
+#ifdef HAVE_WINDOW_SYSTEM
+  int mouse_delta;
+  int phys_x = w->phys_cursor.x;
+#endif
   bool mouse_face_here_p = false;
   struct glyph_matrix *active_glyphs = w->current_matrix;
   struct glyph_row *cursor_row;
@@ -31810,6 +31818,16 @@ erase_phys_cursor (struct window *w)
       && cursor_row->used[TEXT_AREA] > hpos && hpos >= 0)
     mouse_face_here_p = true;
 
+#ifdef HAVE_WINDOW_SYSTEM
+  /* The problem solved by the code below is outlined
+     in the comment above get_cursor_offset_for_mouse_face. */
+  if (mouse_face_here_p)
+    {
+      get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta);
+      w->phys_cursor.x += mouse_delta;
+    }
+#endif
+
   /* Maybe clear the display under the cursor.  */
   if (w->phys_cursor_type == HOLLOW_BOX_CURSOR)
     {
@@ -31845,6 +31863,9 @@ erase_phys_cursor (struct window *w)
   draw_phys_cursor_glyph (w, cursor_row, hl);
 
  mark_cursor_off:
+#ifdef HAVE_WINDOW_SYSTEM
+  w->phys_cursor.x = phys_x;
+#endif
   w->phys_cursor_on_p = false;
   w->phys_cursor_type = NO_CURSOR;
 }
@@ -32081,6 +32102,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
       && hlinfo->mouse_face_end_row < w->current_matrix->nrows)
     {
       bool phys_cursor_on_p = w->phys_cursor_on_p;
+#ifdef HAVE_WINDOW_SYSTEM
+      int mouse_off = 0;
+#endif
       struct glyph_row *row, *first, *last;
 
       first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
@@ -32154,6 +32178,16 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	      row->mouse_face_p
 		= draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
 	    }
+#ifdef HAVE_WINDOW_SYSTEM
+	  if ((MATRIX_ROW_VPOS (row, w->current_matrix)
+	       == w->phys_cursor.vpos)
+	      /* Otherwise this crashes when highlighting a pseudo
+		 window, such as the toolbar which can't have a cursor
+		 anyway. */
+	      && !w->pseudo_window_p
+	      && draw == DRAW_MOUSE_FACE)
+	    get_cursor_offset_for_mouse_face (w, row, &mouse_off);
+#endif
 	}
 
       /* When we've written over the cursor, arrange for it to
@@ -32163,6 +32197,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	{
 #ifdef HAVE_WINDOW_SYSTEM
 	  int hpos = w->phys_cursor.hpos;
+	  int old_phys_cursor_x = w->phys_cursor.x;
 
 	  /* When the window is hscrolled, cursor hpos can legitimately be
 	     out of bounds, but we draw the cursor at the corresponding
@@ -32174,7 +32209,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 
 	  block_input ();
 	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
-				  w->phys_cursor.x, w->phys_cursor.y);
+				  w->phys_cursor.x + mouse_off,
+				  w->phys_cursor.y);
+	  w->phys_cursor.x = old_phys_cursor_x;
 	  unblock_input ();
 #endif	/* HAVE_WINDOW_SYSTEM */
 	}
@@ -35926,4 +35963,110 @@ cancel_hourglass (void)
     }
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
+/* Get the offset to apply before drawing phys_cursor, and return it
+   in OFFSET.  ROW should be a row that is under mouse face and contains
+   the phys cursor.
+
+   This is required because the produce_XXX_glyph series of functions
+   add the width of the various vertical box lines to the total width
+   of the glyph, but isn't updated when the row is put under mouse
+   face, which can have different box dimensions. */
+static void
+get_cursor_offset_for_mouse_face (struct window *w, struct glyph_row *row,
+				  int *offset)
+{
+  int sum = 0;
+  /* Return because the mode line can't possibly have a cursor. */
+  if (row->mode_line_p)
+    return;
+
+  block_input ();
+
+  struct frame *f = WINDOW_XFRAME (w);
+  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+  struct glyph *start, *end;
+  struct face *mouse_face = FACE_FROM_ID (f, hlinfo->mouse_face_face_id);
+  int hpos = w->phys_cursor.hpos;
+  end = &row->glyphs[TEXT_AREA][hpos];
+
+  if (!row->reversed_p)
+    {
+      if (MATRIX_ROW_VPOS (row, w->current_matrix) ==
+ 	  hlinfo->mouse_face_beg_row)
+	start = &row->glyphs[TEXT_AREA][hlinfo->mouse_face_beg_col];
+      else
+	start = row->glyphs[TEXT_AREA];
+    }
+  else
+    {
+      if (MATRIX_ROW_VPOS (row, w->current_matrix) ==
+	  hlinfo->mouse_face_end_row)
+	start = &row->glyphs[TEXT_AREA][hlinfo->mouse_face_end_col];
+      else
+	start = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
+    }
+
+  /* Calculate an offset to correct phys_cursor x if we are
+     drawing the cursor in the mouse face. */
+
+  for (; row->reversed_p ? start >= end : start <= end;
+       row->reversed_p ? --start : ++start)
+    {
+      struct glyph *g = start;
+      struct face *mouse = mouse_face;
+      struct face *regular_face = FACE_FROM_ID (f, g->face_id);
+
+      bool do_left_box_p = g->left_box_line_p;
+      bool do_right_box_p = g->right_box_line_p;
+
+      /* This is required because we test some parameters
+	 of the image slice before applying the box in
+	 produce_image_glyph. */
+
+      if (g->type == IMAGE_GLYPH)
+	{
+	  if (!row->reversed_p)
+	    {
+	      struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						 g->u.img_id);
+	      do_left_box_p = g->left_box_line_p &&
+		g->slice.img.x == 0;
+	      do_right_box_p = g->right_box_line_p &&
+		g->slice.img.x + g->slice.img.width == img->width;
+	    }
+	  else
+	    {
+	      struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						 g->u.img_id);
+	      do_left_box_p = g->left_box_line_p &&
+		g->slice.img.x + g->slice.img.width == img->width;
+	      do_right_box_p = g->right_box_line_p &&
+		g->slice.img.x == 0;
+	    }
+	}
+
+      /* If the glyph has a left box line, subtract it the
+	 offset. */
+      if (do_left_box_p)
+        sum -= max (0, regular_face->box_vertical_line_width);
+      /* Likewise with the right box line, as there may be a
+	 box there as well. */
+      if (do_right_box_p)
+        sum -= max (0, regular_face->box_vertical_line_width);
+      /* Now we add the line widths from the new face. */
+      if (g->left_box_line_p)
+        sum += max (0, mouse->box_vertical_line_width);
+      if (g->right_box_line_p)
+        sum += max (0, mouse->box_vertical_line_width);
+    }
+
+  if (row->reversed_p)
+    sum = -sum;
+
+  *offset = sum;
+
+  unblock_input ();
+}
+#endif
 #endif /* HAVE_WINDOW_SYSTEM */

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 09:46:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 05:46:32 2021
Received: from localhost ([127.0.0.1]:57878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWbbE-0006UE-Ip
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 05:46:32 -0400
Received: from sonic304-20.consmr.mail.ne1.yahoo.com ([66.163.191.146]:37355)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mWbbB-0006Tw-OK
 for 50660 <at> debbugs.gnu.org; Sat, 02 Oct 2021 05:46:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1633167983; bh=/bF4MGxa0sAEgaD3yjiP4QMLYTPK3qeNHv/9Gc3w/Yo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=V/mUaDjq9SPEmE+Seki94g73qr5soJawjmSgSeYGspWE3HlDoNR/81qWWM/5rknW36grj0pAC/B34BT//nfskg8z+Jr4/7nwHv69nFVaXhdpbV3VZx1jjcmNTDw+/7dQr9RP+i/wJjet0X67oPA3crW03pUaxvgjKmCiV69Xus7NzjxZvTXDSeefeT5KW8WW22eISbPyhJ25wsI53TIbaSKOdtnXPrNk0OUnWwqhdjuIuv8ha97NkPgeG4DE+pryq+Th0pf1MleTHTuTZcq9t0NBJTg/U2kgZwMBXnp53gkvI81Yodk8Dco/Qqv78z9cH2E6hh9cInzxplQ6s2m4DQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1633167984; bh=ZUqiYQi7zKpWhrBWUqpL/76gtaLl0C/s5vkR7DQN8UH=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=m3VrCVffhVq04j+NQEheYUeNwdR1RXJJxcmRMS/BUWxXyb8+wu+VjrarrvQMyTj9d3COBiA90OSC/3Yi/8M2kae4q4DrqoJHqUaemx5XrjvnSWGs514fGxFovEBBoC4zpX9BRhtoiKU8jn1XM5v58Y8nr1mf79wh6CyeIATdVLFk2IJTK3vMagfw4KZa7f/8RKvJhf/2Jzos/tqtU4a+UtX7fSNS/nWkwF4+z+SJ+vgkduS540euuG8XTVHSslE0yhG2w/jUpxmbqjc8uFz/3Hy0+hcQjuNAoeRcXy6Vz5e3IVTk5S7VnwKLqbRXcla/Phn1dt+iAJRbBiis1rPOyA==
X-YMail-OSG: 5hEk7p0VM1kzPfxA1iXoJyEfWwIaxhU5sAPSuytxvCcCY5GQkToaI.z7sWXiEOf
 j2b0x6.MfsrwQkTQqlLYhZ5yVUuLNNDy9613wSTQLzR8llZnhT.f7tX2nTFdzV3gwJoZRu4doP3q
 VDPBgQJO8NsMsn4Vp22gh1.03x_Qh2xfy10bch0dXDUp37is8goMKZv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frzxi7QQI8YVa31GpaRzn8tEVE1bNyNd0XdjpOQ8TKh
 5xrBs5aL14T0fG6pn4A--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic304.consmr.mail.ne1.yahoo.com with HTTP; Sat, 2 Oct 2021 09:46:23 +0000
Received: by kubenode516.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 5eed3052e5761a75dff57b6e2f619506; 
 Sat, 02 Oct 2021 09:46:17 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
 <838rzbddfa.fsf@HIDDEN>
Date: Sat, 02 Oct 2021 17:46:14 +0800
In-Reply-To: <838rzbddfa.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 02 Oct
 2021 11:43:53 +0300")
Message-ID: <87mtnrdajd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19076
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 2493
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Thanks, this looks almost right to me, see the minor stylistic
> comments and questions below.  (I didn't yet have time to try the
> patch, but if you did try it in all the relevant combinations,
> including R2L text, that's good enough for me.)

I tried to make it work with RTL text, but right now I don't have access
to the machine where I developed that patch, so I wasn't able to test
it.  (For me to move code between machines at work onto my personal
machine is difficult due to the policies of my organization.  But they
have no issue with making the changes public.  Oh well, can't convince
the suits.)

I will correct the issues ASAP.

> But it looks like the code in both conditions is the same?  More
> generally, what kind of problem specific to images does this part try
> to handle?

Thanks, I think that's a problem.  The conditions should be different
depending on whether or not the row is reversed, because
produce_image_glyph uses start_of_box_run_p and end_of_box_run_p, which
AFAIU is unaffected by the row being reversed.

This part exists to take into account produce_image_glyph testing for
several conditions being met before appending the box width to the
iterator.

(See this part of produce_image_glyph, somewhere around line 29542:)

	  if (it->start_of_box_run_p && slice.x == 0)
                                        ^^^^^^^^^^^^
	    it->pixel_width += face->box_vertical_line_width;
	  if (it->end_of_box_run_p && slice.x + slice.width == img->width)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    it->pixel_width += face->box_vertical_line_width;

I suppose it should be made a comment.  That will be done shortly,
thanks.


>> +      if (do_left_box_p)
>> +        *offset -= max (0, regular_face->box_vertical_line_width);
>> +      /* Likewise with the right box line, as there may be a
>> +	 box there as well. */
>> +      if (do_right_box_p)
>> +        *offset -= max (0, regular_face->box_vertical_line_width);

> There's no reason to use -= and += here.  The callers never initialize
> the argument to anything but zero, nor should they.  This function
> _calculates_ the offset, it doesn't _correct_ it.  So a simple
> assignment should do better, because using the above begs the
> question: what could the initial value be?  The callers should add or
> subtract the corrections as they see fit.

Yes, that one is specifically one of my vices.  Thanks for pointing it
out.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 08:44:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 04:44:22 2021
Received: from localhost ([127.0.0.1]:57796 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWad4-0002gH-26
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 04:44:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48274)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mWad0-0002g2-Pz
 for 50660 <at> debbugs.gnu.org; Sat, 02 Oct 2021 04:44:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47792)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mWacu-0003vK-HN; Sat, 02 Oct 2021 04:44:13 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4280
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mWacs-0001C9-Fc; Sat, 02 Oct 2021 04:44:11 -0400
Date: Sat, 02 Oct 2021 11:43:53 +0300
Message-Id: <838rzbddfa.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87k0j0rwo3.fsf@HIDDEN> (message from Po Lu on Wed, 29 Sep
 2021 09:35:24 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <831r5l5d6d.fsf@HIDDEN>
 <87h7egy8jo.fsf@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN> <87k0j0rwo3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Wed, 29 Sep 2021 09:35:24 +0800
> 
> Thanks, but I think I've already solved the problem.  Can you try the
> attached patch and see if there are any problems with it?  TIA

Thanks, this looks almost right to me, see the minor stylistic
comments and questions below.  (I didn't yet have time to try the
patch, but if you did try it in all the relevant combinations,
including R2L text, that's good enough for me.)

> +      if (cursor_in_mouse_face_p (w)
> +	  && cursor_on_p)

This could be on a single line.

> +#ifdef HAVE_WINDOW_SYSTEM
> +  if (mouse_face_here_p)
> +    {
> +      get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta);
> +      w->phys_cursor.x += mouse_delta;
> +    }
> +#endif

Please add a comment here explaining the problem and the general idea
of the solution.

> +#ifdef HAVE_WINDOW_SYSTEM
> +	  if (MATRIX_ROW_VPOS (row, w->current_matrix)
> +	      == w->phys_cursor.vpos && !w->pseudo_window_p
> +	      && draw == DRAW_MOUSE_FACE)

Style: we line up the logical && and || operators, like this:

    if ((MATRIX_ROW_VPOS (row, w->current_matrix)
         == w->phys_cursor.vpos)
        && !w->pseudo_window_p
        && draw == DRAW_MOUSE_FACE)

> +#ifdef HAVE_WINDOW_SYSTEM
> +/* Get the offset to apply before drawing phys_cursor, and return it
> +   in OFFSET, if ROW has something currently under mouse face. */

This comment doesn't tell the main part of the function's job, which
is related to the box face.  Please include that, and please explain
in the comment why the box face requires the offset for the cursor.

> +  if (row->mode_line_p)
> +    return;

This warrants a comment regarding the reason why the function returns
in that case.

> +  for (; start != end; row->reversed_p ?
> +	 --start : ++start)

Style: this should not break the last part of the 'for'.  Like this:

     for (; start != end; row->reversed_p ? --start : ++start)

> +      if (row->reversed_p && g->type == IMAGE_GLYPH)
> +	{
> +	  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
> +					     g->u.img_id);
> +	  do_left_box_p = g->left_box_line_p &&
> +	    g->slice.img.x + g->slice.img.width == img->width;
> +	  do_right_box_p = g->right_box_line_p &&
> +	    g->slice.img.x == 0;
> +	}
> +      else if (g->type == IMAGE_GLYPH)
> +	{
> +	  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
> +					     g->u.img_id);
> +	  do_left_box_p = g->left_box_line_p &&
> +	    g->slice.img.x + g->slice.img.width == img->width;
> +	  do_right_box_p = g->right_box_line_p &&
> +	    g->slice.img.x == 0;
> +	}

It is better to have a two-level if here:

    if (g->type == IMAGE_GLYPH)
      {
        if (row->reversed_p)
	  {
	    ...
	  }
	else
	  {
	    ...
	  }

But it looks like the code in both conditions is the same?  More
generally, what kind of problem specific to images does this part try
to handle?

> +      if (do_left_box_p)
> +        *offset -= max (0, regular_face->box_vertical_line_width);
> +      /* Likewise with the right box line, as there may be a
> +	 box there as well. */
> +      if (do_right_box_p)
> +        *offset -= max (0, regular_face->box_vertical_line_width);

There's no reason to use -= and += here.  The callers never initialize
the argument to anything but zero, nor should they.  This function
_calculates_ the offset, it doesn't _correct_ it.  So a simple
assignment should do better, because using the above begs the
question: what could the initial value be?  The callers should add or
subtract the corrections as they see fit.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 29 Sep 2021 01:35:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 28 21:35:39 2021
Received: from localhost ([127.0.0.1]:47371 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mVOVX-0006uN-7Q
	for submit <at> debbugs.gnu.org; Tue, 28 Sep 2021 21:35:39 -0400
Received: from sonic311-25.consmr.mail.ne1.yahoo.com ([66.163.188.206]:45659)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mVOVV-0006u6-Az
 for 50660 <at> debbugs.gnu.org; Tue, 28 Sep 2021 21:35:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632879331; bh=zBKbJ4kAeS8SeB2Mcb+xpqUuVIF2L39/r4Dl+Uk58jU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=EVGICte4bbxzqfMzlN4yrJIw+luvoscPN4bN4zTuNMY1DmZLE6o08OD9/GCsz2MflDqY0gShNz7lrdDl9QyB0SMgcjPOLkcAddbQUs/O/9XuV1CswAoTbw/mmfR4PnTqvWUWGN6v+2Ur3McxwlFvhcvLBhVeq2+IttWqkDbDTHfQVcpAhy0tIkcqQpv6HeryhlsnlMXEBkTTFk8OTyv4aQBmeLi9+592Pn3lLfiQqNNr4eDayMov1q88xY9ppzDFWJ/m6D6KjiGEXamQITjCu8IdrnvViXJSWALEw909LDrJoxLf56zoUJFHQbU44AaZN38upaFJSC0lL2X9ktG0mg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632879331; bh=vbyXhI7FPOVxGyxOx3h2upZUs4yhmAN2OfJxSBsWrcV=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Sub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Q.h3QBtu5W6OPCE7H7ya5s.CCgwXXkSljxRG0KP9lrqZOO8NXv29lB9G79GcckA61zHm8jcOR
 7Yq9kQCaKvGds6yjwgAm5lCZItYxsZwrCb41LmltfndbuVfpp5IQp7HIh24G1MEWXeGm36hjcx0c
 ZAo1LU0YnGRc.DdgZwHyIq6YfwvoI5Bi5iqcaXOxnhLghbmMIHiS8nr2TgbGydzMK5BZpLR5laSp
 Q5zfsCFAQLoZAw4ALuaVpJPmhAkBHy_osBSsbSOAh4ge_08tuzp5Fq1mzyjUPWW1kWf_sthQQj0X
 OOqSPEwfxiVgdQ3FMNrx6c1ipLwDfM5c5ADv1NIS0JRtIjGr_fVD8_Qxy5FGkhVHt99N50RSOYvw
 a_ZHLw6nyVwtQ41MQBFd0Pl3nfX_zhYgHSjCw7ezccKXmBVhYkEdW2Vg.vCoop11fW9eU3v_30KT
 UuQH6AyzUKBXf.K2YnqWvk60981TK8zjIBLUE0Zj81alkxI91V.vuckUQNQPDi9CZdaNOCEk1p.J
 OO8268vuPBNXRwL37vcqIWd9InRvIwDYA6p1ughkPGUkhbg8gU6Vp_VykAUp1WW2GfQn1OXMVHDC
 MhNcUY3xCH2OAFIIHRsY_
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic311.consmr.mail.ne1.yahoo.com with HTTP; Wed, 29 Sep 2021 01:35:31 +0000
Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 831b07e6fce55893d6acc38bd120bc54; 
 Wed, 29 Sep 2021 01:35:27 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <831r5l5d6d.fsf@HIDDEN>
 <87h7egy8jo.fsf@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
 <83v92mkzft.fsf@HIDDEN>
Date: Wed, 29 Sep 2021 09:35:24 +0800
In-Reply-To: <83v92mkzft.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 27 Sep
 2021 14:52:54 +0300")
Message-ID: <87k0j0rwo3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19076
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 7116
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

> I think I'm still a bit confused.  Can you show the patch you have
> where you see these problems with erase_phys_cursor?

Thanks, but I think I've already solved the problem.  Can you try the
attached patch and see if there are any problems with it?  TIA


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-cursor-position.patch

diff --git a/src/dispnew.c b/src/dispnew.c
index 0c31319917..f58e1d28e4 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3848,6 +3848,10 @@ gui_update_window_end (struct window *w, bool cursor_on_p,
 				w->output_cursor.hpos, w->output_cursor.vpos,
 				w->output_cursor.x, w->output_cursor.y);
 
+      if (cursor_in_mouse_face_p (w)
+	  && cursor_on_p)
+	mouse_face_overwritten_p = 1;
+
       if (draw_window_fringes (w, true))
 	{
 	  if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
diff --git a/src/xdisp.c b/src/xdisp.c
index 2e72f6b591..f542b3f526 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1179,7 +1179,9 @@ #define face_after_it_pos(IT)  face_before_or_after_it_pos (IT, false)
 static Lisp_Object get_it_property (struct it *, Lisp_Object);
 static Lisp_Object calc_line_height_property (struct it *, Lisp_Object,
 					      struct font *, int, bool);
-
+static void get_cursor_offset_for_mouse_face (struct window *w,
+					      struct glyph_row *row,
+					      int *offset)
 #endif /* HAVE_WINDOW_SYSTEM */
 
 static void produce_special_glyphs (struct it *, enum display_element_type);
@@ -31741,6 +31743,10 @@ erase_phys_cursor (struct window *w)
   Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
   int hpos = w->phys_cursor.hpos;
   int vpos = w->phys_cursor.vpos;
+#ifdef HAVE_WINDOW_SYSTEM
+  int mouse_delta = 0;
+  int phys_x = w->phys_cursor.x;
+#endif
   bool mouse_face_here_p = false;
   struct glyph_matrix *active_glyphs = w->current_matrix;
   struct glyph_row *cursor_row;
@@ -31810,6 +31816,14 @@ erase_phys_cursor (struct window *w)
       && cursor_row->used[TEXT_AREA] > hpos && hpos >= 0)
     mouse_face_here_p = true;
 
+#ifdef HAVE_WINDOW_SYSTEM
+  if (mouse_face_here_p)
+    {
+      get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta);
+      w->phys_cursor.x += mouse_delta;
+    }
+#endif
+
   /* Maybe clear the display under the cursor.  */
   if (w->phys_cursor_type == HOLLOW_BOX_CURSOR)
     {
@@ -31845,6 +31859,9 @@ erase_phys_cursor (struct window *w)
   draw_phys_cursor_glyph (w, cursor_row, hl);
 
  mark_cursor_off:
+#ifdef HAVE_WINDOW_SYSTEM
+  w->phys_cursor.x = phys_x;
+#endif
   w->phys_cursor_on_p = false;
   w->phys_cursor_type = NO_CURSOR;
 }
@@ -32081,6 +32098,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
       && hlinfo->mouse_face_end_row < w->current_matrix->nrows)
     {
       bool phys_cursor_on_p = w->phys_cursor_on_p;
+#ifdef HAVE_WINDOW_SYSTEM
+      int mouse_off = 0;
+#endif
       struct glyph_row *row, *first, *last;
 
       first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
@@ -32154,6 +32174,12 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	      row->mouse_face_p
 		= draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
 	    }
+#ifdef HAVE_WINDOW_SYSTEM
+	  if (MATRIX_ROW_VPOS (row, w->current_matrix)
+	      == w->phys_cursor.vpos && !w->pseudo_window_p
+	      && draw == DRAW_MOUSE_FACE)
+	    get_cursor_offset_for_mouse_face (w, row, &mouse_off);
+#endif
 	}
 
       /* When we've written over the cursor, arrange for it to
@@ -32163,6 +32189,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	{
 #ifdef HAVE_WINDOW_SYSTEM
 	  int hpos = w->phys_cursor.hpos;
+	  int old_phys_cursor_x = w->phys_cursor.x;
 
 	  /* When the window is hscrolled, cursor hpos can legitimately be
 	     out of bounds, but we draw the cursor at the corresponding
@@ -32174,7 +32201,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 
 	  block_input ();
 	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
-				  w->phys_cursor.x, w->phys_cursor.y);
+				  w->phys_cursor.x + mouse_off,
+				  w->phys_cursor.y);
+	  w->phys_cursor.x = old_phys_cursor_x;
 	  unblock_input ();
 #endif	/* HAVE_WINDOW_SYSTEM */
 	}
@@ -35926,4 +35955,89 @@ cancel_hourglass (void)
     }
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
+/* Get the offset to apply before drawing phys_cursor, and return it
+   in OFFSET, if ROW has something currently under mouse face. */
+static void
+get_cursor_offset_for_mouse_face (struct window *w, struct glyph_row *row,
+				  int *offset)
+{
+  if (row->mode_line_p)
+    return;
+  block_input ();
+
+  struct frame *f = WINDOW_XFRAME (w);
+  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+  struct glyph *start, *end;
+  struct face *mouse_face = FACE_FROM_ID (f, hlinfo->mouse_face_face_id);
+  int hpos = w->phys_cursor.hpos;
+  end = &row->glyphs[TEXT_AREA][hpos];
+
+  if (!row->reversed_p)
+    {
+      if (MATRIX_ROW_VPOS (row, w->current_matrix) ==
+ 	  hlinfo->mouse_face_beg_row)
+	start = &row->glyphs[TEXT_AREA][hlinfo->mouse_face_beg_col];
+      else
+	start = row->glyphs[TEXT_AREA];
+    }
+  else
+    {
+      if (MATRIX_ROW_VPOS (row, w->current_matrix) ==
+	  hlinfo->mouse_face_end_row)
+	start = &row->glyphs[TEXT_AREA][hlinfo->mouse_face_end_col];
+      else
+	start = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
+    }
+
+  /* Calculate an offset to correct phys_cursor x if we are
+     drawing the cursor in the mouse face. */
+
+  for (; start != end; row->reversed_p ?
+	 --start : ++start)
+    {
+      struct glyph *g = start;
+      struct face *mouse = mouse_face;
+      struct face *regular_face = FACE_FROM_ID (f, g->face_id);
+
+      bool do_left_box_p = g->left_box_line_p;
+      bool do_right_box_p = g->right_box_line_p;
+
+      if (row->reversed_p && g->type == IMAGE_GLYPH)
+	{
+	  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+					     g->u.img_id);
+	  do_left_box_p = g->left_box_line_p &&
+	    g->slice.img.x + g->slice.img.width == img->width;
+	  do_right_box_p = g->right_box_line_p &&
+	    g->slice.img.x == 0;
+	}
+      else if (g->type == IMAGE_GLYPH)
+	{
+	  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+					     g->u.img_id);
+	  do_left_box_p = g->left_box_line_p &&
+	    g->slice.img.x + g->slice.img.width == img->width;
+	  do_right_box_p = g->right_box_line_p &&
+	    g->slice.img.x == 0;
+	}
+
+      /* If the glyph has a left box line, subtract it the
+	 offset. */
+      if (do_left_box_p)
+        *offset -= max (0, regular_face->box_vertical_line_width);
+      /* Likewise with the right box line, as there may be a
+	 box there as well. */
+      if (do_right_box_p)
+        *offset -= max (0, regular_face->box_vertical_line_width);
+      /* Now we add the line widths from the new face. */
+      if (g->left_box_line_p)
+	*offset += max (0, mouse->box_vertical_line_width);
+      if (g->right_box_line_p)
+        *offset += max (0, mouse->box_vertical_line_width);
+    }
+
+  unblock_input ();
+}
+#endif
 #endif /* HAVE_WINDOW_SYSTEM */

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 27 Sep 2021 11:52:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 27 07:52:57 2021
Received: from localhost ([127.0.0.1]:39914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mUpBp-0006W7-FY
	for submit <at> debbugs.gnu.org; Mon, 27 Sep 2021 07:52:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50008)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mUpBn-0006Vn-G5
 for 50660 <at> debbugs.gnu.org; Mon, 27 Sep 2021 07:52:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51958)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mUpBi-0006Qr-3q; Mon, 27 Sep 2021 07:52:50 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3031
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mUpBh-0004uS-NV; Mon, 27 Sep 2021 07:52:50 -0400
Date: Mon, 27 Sep 2021 14:52:54 +0300
Message-Id: <83v92mkzft.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <871r5bvex8.fsf@HIDDEN> (message from Po Lu on Sun, 26 Sep
 2021 17:56:03 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87y27uro4c.fsf@HIDDEN>
 <877dfdz9ni.fsf@HIDDEN> <831r5l5d6d.fsf@HIDDEN>
 <87h7egy8jo.fsf@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN> <871r5bvex8.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Sun, 26 Sep 2021 17:56:03 +0800
> 
> > First, which call to display_and_set_cursor are we talking about?
> 
> The call inside show_mouse_face.
> 
> > And what do you mean by "erase_phys_cursor gets very confused" --
> > confused how?
> 
> It calls draw_phys_cursor_glyph, which draws the glyph at the original X
> position, and not the position with the mouse face offset applied.
> 
> What I was asking is whether or not it's okay to not restore
> phys_cursor->x to its original value after the call to
> display_and_set_cursor inside show_mouse_face, or if I should also
> calculate and add the offset in erase_phys_cursor (if
> cursor_in_mouse_face_p) instead.

I think I'm still a bit confused.  Can you show the patch you have
where you see these problems with erase_phys_cursor?

P.S. And sorry for the delay in answering.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 09:56:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 26 05:56:16 2021
Received: from localhost ([127.0.0.1]:35948 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mUQtM-0006WF-P8
	for submit <at> debbugs.gnu.org; Sun, 26 Sep 2021 05:56:16 -0400
Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]:42548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mUQtM-0006Vy-46
 for 50660 <at> debbugs.gnu.org; Sun, 26 Sep 2021 05:56:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632650170; bh=4PntVY/xM9VWZ4G4TZQ4pBTmNvHqbNmNG/Upbo7jcLs=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=GC5n49LDb02TO4u/A0Uo9tZI2+3TdD1Wr/iPtZuIpXfKusmswnNOGhz+db0OMMY5yXJmil9e8CJYboRQlAkC8HjWKyjNQgRs8L5Vb+A2vwCJji3uWsAIt8fASPlB04xIC87wDM0h9fwgRh2dG3vWDlbl9GYYEr3q8qV9hk/Ky2XslMRrDtJLRhZijsvCa5VdnzrDKwS51nb63Nh5wTlROWF7h0s9d7VpBAh97hhAxVYV2XrlSM8Ne2Y69TmNbMzx4IYmz8B8+rIJPqmAMRXrK1sV8eO+ygyG+4zOF+F+W5AE5a4iCQIPxiQhmfqZz8xi7UEBLYc1sCdLjB9cuksTVA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632650170; bh=AyttSIRd50vq8dbPa6zv/29/T/pGAfgQLjRXS6EZqlN=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=c7JQBkn3bnGtOUe177mpmMxxeBoYdOvPJ8Du31SmFC01NWk0gR2YWrzOHJa/V2iEn5aEjwxLDXc7km6RqD/LSQ/scfRuPy50kHovZOJCGSzM1n4FNZQodkuwoveMKYKheyTRcHBB5C3Kuo66dbCqITYrRjoBmDcLl1mgbu4UNK0fcuomoeMpTyre9E4sNGQSVLElGEUG287QhQaj7xFj/axFD7VD5gwyePH9+jTDWBpJU8r/1LYalanrkld0+egAly4vpkRtHUHGv3jefKnJ43q8bJqgFEAfgbeKKsi4jH/Zqq7ilSgRaLZU19Cnl7VlkH8RfsKP1Pr8DVJJrCLeKg==
X-YMail-OSG: Js5fWbMVM1nszG6r4euGwicTCEFWGebxut3jYMH7.RIlAz7ovu3oA.aQKPqsK90
 AdB31gihb3925fOHsMfp1K_nDfpdhHmGwo709kvM9i1Yo_d5ozT_K3qv_jCfchehPPbgbJ43nByy
 BQ_5xgZYYLZNnPm393jA0UOWlQlnXoeVgHnVLAsFaD0vq3Cw8WByD0GcPM0zFYrA4Z46xdKVVLsU
 vCUhu900v.uNZJvp34tf58pNINNRFFsEQalqKkdUmffigEzhNiQcJDMB04WfYT2gunUZh7lLBBHs
 RAZ7seHve0Q01ODXornlvlwgl5wccoMnVzwv_zRnJnU6f6I.1vHhnymkzTn5aRrBNT3rWP7pycNZ
 TVJ1ssCdwyi23nrX8lcY5np682Eepgnhv0fg_e9EIPTGmH8j2TTg0V3pgzGSc9OSIvgQ3bOqjv20
 qbdDzBVGN0gGTVhhEWqKpf.z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mtfw4mw0vvS7uvksjHNCK257l7HvV5x1X09liJn1WyuNb5ij9tekwCKZ.AW2CabTDNPc
 _Ej0dsmyzPrbJLTXc2HUmDyU9GXIbeV5XTTvvGFPwUFKeE2PJwnGey2k9nyKm9qVuDdltQN1ai1I
 UmP9gTpH5J7eByVs2v2zn..Jtze7V9jGAB_fWpyx7awGqLhYewlO4cifULkzcd3jaJeZ5fFbpwB3
 7bt1MmPTJV56ihTbkqrT55zskV5dVg8fsZat1Wp4WN6jQmJQwNDMO3mFYH.ZP4hZk.sCenvLWX7o
 MHurD1AwV46oLvkHoslhpVUWFtxdZOLteVzutbGjBvQ171nmqd4Q._jnshLYBKU5g.4Dteya5q1f
 z6uydF.ST5lczNyKIN2yryeHiR0bjDYaFlXW2XNG4yxeZd.Wjd.xNbfTaqpK7CHUKt3CpouEBK4r
 d8h2hcxPFDy5G0Wz6iCHAooGe79KdgivIe5RHxxtTMDObZ8RlKAs8F0riwEWTLTf2iaSWJmRBker
 qZTUyLaZWEqA_ScalmiC9jGlynhnhbDw3vhTfQtC0yFPjaYS0BYXGZmeGGqsWVQWs.vS.ub8tegG
 4gtY8CsdSsaF4wQohuLCJ1j1ke38TU76CVUGe7bRhMK_TtTew0HzrI1C6bEFYEi.OWSkDqhO6oJN
 8u5NPT1ktVwmzqA_t9Z_vB98kItLVbjlo21uW1yGyU8W4zMVUT_rsyTUPa8p5SpOf3ENLIj8TvTd
 IlG6Qe14ew3uDFzCwB8Xgih03rEHg71iQKVbXTKwh6fUWi_OBKVGfKkLSHnn7z_TA9k7nPCAJ69l
 BxMT1BnZWzVQeF7eLZ6jN
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic301.consmr.mail.ne1.yahoo.com with HTTP; Sun, 26 Sep 2021 09:56:10 +0000
Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID fd4c00dc6563f59e62d0c4de5a74533c; 
 Sun, 26 Sep 2021 09:56:06 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87y27uro4c.fsf@HIDDEN>
 <877dfdz9ni.fsf@HIDDEN> <831r5l5d6d.fsf@HIDDEN>
 <87h7egy8jo.fsf@HIDDEN> <838rzs4i09.fsf@HIDDEN>
 <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN> <8335pz3dli.fsf@HIDDEN>
 <87r1dj4q4m.fsf@HIDDEN> <83zgs71su7.fsf@HIDDEN>
 <87k0jb4k5l.fsf@HIDDEN> <83sfxz1pw0.fsf@HIDDEN>
 <87o88m14g0.fsf@HIDDEN> <83sfxyxeer.fsf@HIDDEN>
 <87h7ee1252.fsf@HIDDEN> <83pmt2xcox.fsf@HIDDEN>
 <87lf3myhlb.fsf@HIDDEN> <87a6jzvnpq.fsf@HIDDEN>
 <83o88fom1k.fsf@HIDDEN>
Date: Sun, 26 Sep 2021 17:56:03 +0800
In-Reply-To: <83o88fom1k.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 26 Sep
 2021 10:04:07 +0300")
Message-ID: <871r5bvex8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 758
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> I don't think I understand the situation well enough to answer these
> questions.

Thanks, I'll try to explain.

> First, which call to display_and_set_cursor are we talking about?

The call inside show_mouse_face.

> And what do you mean by "erase_phys_cursor gets very confused" --
> confused how?

It calls draw_phys_cursor_glyph, which draws the glyph at the original X
position, and not the position with the mouse face offset applied.

What I was asking is whether or not it's okay to not restore
phys_cursor->x to its original value after the call to
display_and_set_cursor inside show_mouse_face, or if I should also
calculate and add the offset in erase_phys_cursor (if
cursor_in_mouse_face_p) instead.

TIA.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 07:04:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 26 03:04:14 2021
Received: from localhost ([127.0.0.1]:35614 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mUOCs-0005vg-0v
	for submit <at> debbugs.gnu.org; Sun, 26 Sep 2021 03:04:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34498)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mUOCq-0005vU-EC
 for 50660 <at> debbugs.gnu.org; Sun, 26 Sep 2021 03:04:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37550)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mUOCl-0001Tz-8m; Sun, 26 Sep 2021 03:04:07 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3007
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mUOCk-0007SE-Rg; Sun, 26 Sep 2021 03:04:07 -0400
Date: Sun, 26 Sep 2021 10:04:07 +0300
Message-Id: <83o88fom1k.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87a6jzvnpq.fsf@HIDDEN> (message from Po Lu on Sun, 26 Sep
 2021 14:46:09 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
 <83pmt2xcox.fsf@HIDDEN> <87lf3myhlb.fsf@HIDDEN>
 <87a6jzvnpq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Sun, 26 Sep 2021 14:46:09 +0800
> 
> Po Lu <luangruo@HIDDEN> writes:
> 
> > I found the issue with that.  Hopefully, in a bit, I will have something
> > ready to work, but in the meantime I noticed another problem:
> 
> Thanks, another question: if I restore the original value of
> phys_cursor->x after the call to display_and_set_cursor,
> erase_phys_cursor gets very confused the next time it is called.
> 
> If I don't restore the original value, everything appears to work fine.
> 
> Should I replicate the cursor offset logic in erase_phys_cursor, or
> should I keep the new value of phys_cursor->x?  Thanks.

I don't think I understand the situation well enough to answer these
questions.

First, which call to display_and_set_cursor are we talking about?
And what do you mean by "erase_phys_cursor gets very confused" --
confused how?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 06:46:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 26 02:46:26 2021
Received: from localhost ([127.0.0.1]:35583 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mUNve-0002JC-IF
	for submit <at> debbugs.gnu.org; Sun, 26 Sep 2021 02:46:26 -0400
Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:39835)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mUNvd-0002DQ-0V
 for 50660 <at> debbugs.gnu.org; Sun, 26 Sep 2021 02:46:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632638779; bh=pjYLcJECGOw3fGWA23+fAk67onT+137BWj3xCPgHLpU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=gDl0BkVyJUwQOKHQ124gZpceAcDakAR8HAvAeMX0/yQJvR2+LrrEa/Icx1Jb+DDENB2atYjkdLtweB3sMWLrwKk/dcTcbX1ygicBckUI6hs6SPz6d863TLDBH6rTZvH2ZOnI29MI2a0GSrsbjFm+LOscOkjzckqbiYxtq1YgZPDVDpl7K2uEDm9mIUJTro4jAPjwwZQ+aoo/ejvtqL83MuEUVL491Cg0h1YlRe397sGvjQEkJrH4wMolnYRJV6/g4jKwLEFGTiRDUpT/llKpHUNb0UEarZm20peqGls+tpLkFhw1pjzC26wC24GR00RR0iFxpoadOmAHYc8W1gLhGQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632638779; bh=yU6JApuOyE0KE0kBGopF/k73zE9+7LD/5MtKkWTtKYR=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=URMpwFR8EClBFlovvCneLu3N8JkU9ckvsd5/7oZXosfCd7f+f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jh1Ws_t43H4Quzr7
 SwbejoxVF4whVGLjSGj11ZvMJbBQN9yNEJDOSFZZrJGXr0xP068qY32o8bXc_O.nE2xClZbrLH.r
 nEAVrnJKMu36EuUsTtsAUL3esp2ZkPZRyZMmPHhQRjRe.fkK8r1rkfJj.bimafmrKDO9yz5ZSKtI
 BRsj_IpRz0SfRECku3UnX63oaH_guWemUwN23uYwTTyTnLd1LeiADEfE7MIjZl0x3TLxkxPYGuqY
 HlAgDt1.O.UnkBeMxS7Z0ZDupYlqYMfMsAoo6BvM9gaPyUlfME_6pHgVMG_fouPDMJVOB7qumpLk
 TLhlOShBx92CiywMybAv106YFFr1xML6_iNvoGdlb4AwYzDDgtfvkkOYYHaoNRxFKCpm30so9Te6
 BFaMxMDkbJdz5GQiO2xpc5Y.JE9hUTM2M.5s4ePEpfD3lTvE0ogaApgC4xN1HjVE3vcemxjhbU0f
 GyR6NAGabs3szdFoLEBaBGuwKI4f4bw45H8x1Snk8Lqv5kV6Ov5NQcQHd84Kmcr9Eu0bVEXmsUA8
 0TqEjOjysGvH_3eGPQDk-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic305.consmr.mail.ne1.yahoo.com with HTTP; Sun, 26 Sep 2021 06:46:19 +0000
Received: by kubenode517.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 0eac739da077d31075097b0da5303552; 
 Sun, 26 Sep 2021 06:46:13 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
 <83pmt2xcox.fsf@HIDDEN> <87lf3myhlb.fsf@HIDDEN>
Date: Sun, 26 Sep 2021 14:46:09 +0800
In-Reply-To: <87lf3myhlb.fsf@HIDDEN> (Po Lu's message of "Fri, 24 Sep 2021
 07:53:20 +0800")
Message-ID: <87a6jzvnpq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 557
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Po Lu <luangruo@HIDDEN> writes:

> I found the issue with that.  Hopefully, in a bit, I will have something
> ready to work, but in the meantime I noticed another problem:

Thanks, another question: if I restore the original value of
phys_cursor->x after the call to display_and_set_cursor,
erase_phys_cursor gets very confused the next time it is called.

If I don't restore the original value, everything appears to work fine.

Should I replicate the cursor offset logic in erase_phys_cursor, or
should I keep the new value of phys_cursor->x?  Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 24 Sep 2021 06:47:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 24 02:47:17 2021
Received: from localhost ([127.0.0.1]:56527 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTezN-0001Jx-LS
	for submit <at> debbugs.gnu.org; Fri, 24 Sep 2021 02:47:17 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44086)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mTezL-0001Jh-Fr
 for 50660 <at> debbugs.gnu.org; Fri, 24 Sep 2021 02:47:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45452)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mTezF-00017q-Uh; Fri, 24 Sep 2021 02:47:10 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3649
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mTezF-0008V9-2R; Fri, 24 Sep 2021 02:47:09 -0400
Date: Fri, 24 Sep 2021 09:47:05 +0300
Message-Id: <83h7eatqqe.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87lf3myhlb.fsf@HIDDEN> (message from Po Lu on Fri, 24 Sep
 2021 07:53:20 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
 <83pmt2xcox.fsf@HIDDEN> <87lf3myhlb.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Fri, 24 Sep 2021 07:53:20 +0800
> 
> If the mouse face's box is set to something preposterous, like (:box
> 10000), the entire row is occluded by the box, and doesn't become
> visible again when canceling mouse face.  Only redraw-display makes the
> problem go away.

Emacs gives enough rope for Lisp programmers to hang themselves.  When
they try doing that, our only job is not to crash.  IOW, producing
preposterous display results for preposterous settings is justified;
we don't need to go out of our way to cater to ridiculous parameter
values like the one above, we only need to avoid crashing.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 23 Sep 2021 23:53:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 19:53:39 2021
Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTYX5-0006jN-03
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 19:53:39 -0400
Received: from sonic310-25.consmr.mail.ne1.yahoo.com ([66.163.186.206]:36877)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mTYX3-0006j9-E3
 for 50660 <at> debbugs.gnu.org; Thu, 23 Sep 2021 19:53:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632441211; bh=mFc8yUV8apXZdvIIlSSCkayr2Vly8VF8dU2/+MXMFfY=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=e9wZ63efgbpB5l6UMNGJEKIGaPN2cKzlmPaKFLBMGrwplYUKt5sDQwYRQEueOPDcD5erRtyqIoUdQGYxmJgMc6+XHKCCsy01oqa8Nl8Q7FwkFSbB1vpjSi4uGxmLfjl3r+Drl9eREOKANgX0eUpYgKqUJXQNrvN9hF/QxU+FyubSVMVlMdW4iBBV/pd2kCoQBgxuC0AElAfQJHo7Loo8jkRaR1aHLskDR5nxMw1akzRi3XokWiCZsAMKqLpGHdGOndHZfJyso+faZNO9IWyGmdB2UAnNgiCN1zEQAqnNamiRNrkB7yRn+cmqoJfiWprCV+l++vASIDQEHb0JjLxIPQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632441211; bh=o+rWrgrwNBorcB446/6jUa0fBWVLTZPLfczO3nZeUmN=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=bG/oD2205EKlRpEjF5071mY0dqVYZmnzqVdGaDPPbLv+m/UGT2B6xclXGsZk8aY7tk856yo3KL3TLrxLZo6Wz50FZW7TTaA+dSaofogzsKEz5C1JvGRN4s7RqqKSrkrpW7vfFnBetc3aVB9EIPWY4fsujyjIisODldNwP/JFyjPbCMJDneYRkqGBt6pXXS5Ctey5EEYpxE7iluioudNJCtbmmeS+Aaxvkm/z5HFJjhMphZyEvRxW4r+ebi8EzX7Q+oXRHByXnvp/D70opf6YLAgnZKglOGOFyW3OqRYvAqR6YJc+a3hqcH6BoHA7OiXR155xVNjJkz5bTOxov+h6CQ==
X-YMail-OSG: MKESG9EVM1mZBcEO3nAAtADGAQ2i6dGqNOpGl.jts0NWA8ouWX42ERsHjxrEIF2
 7MQCXjH460wNDBRlUpZiyHVEk45ePUdNh8by0czktf02Wd2mhNbUA6xPGUBhe22cV_r4O7XaJ6aI
 YGwwmkJDBQ_t7.4EJSxbGX9NFVq8hHcFkKVNWRxQbAN2uLOSr1NCu.JIUbaHCEMyGq5IikbEa2uE
 pSw501AaK_63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SQ6v2shFcZ8c
 L9IdmD.qdxReh2g--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.ne1.yahoo.com with HTTP; Thu, 23 Sep 2021 23:53:31 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 507c982a98e2bf79cbb3a5b82f9be5f2; 
 Thu, 23 Sep 2021 23:53:23 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
 <83pmt2xcox.fsf@HIDDEN>
Date: Fri, 24 Sep 2021 07:53:20 +0800
In-Reply-To: <83pmt2xcox.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Sep
 2021 16:47:42 +0300")
Message-ID: <87lf3myhlb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 618
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> It's definitely not what I see here.  I see the value that is the
> screen line number of the cursor.  If the cursor is on the first
> screen line, the value is indeed zero (VPOS is zero-based), but not in
> general.

I found the issue with that.  Hopefully, in a bit, I will have something
ready to work, but in the meantime I noticed another problem:

If the mouse face's box is set to something preposterous, like (:box
10000), the entire row is occluded by the box, and doesn't become
visible again when canceling mouse face.  Only redraw-display makes the
problem go away.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:47:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 09:47:56 2021
Received: from localhost ([127.0.0.1]:45471 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSg7o-00065k-NZ
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:47:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47432)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSg7n-00064y-4u
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:47:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50744)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSg7h-00021Y-Ay; Tue, 21 Sep 2021 09:47:49 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3492
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSg7g-000505-UY; Tue, 21 Sep 2021 09:47:49 -0400
Date: Tue, 21 Sep 2021 16:47:42 +0300
Message-Id: <83pmt2xcox.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87h7ee1252.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 21:36:41 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN> <87h7ee1252.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 21:36:41 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Are you saying the vpos is _always_ zero?  I don't see how this could
> > be true, because display_and_set_cursor uses that to find the glyph
> > row that corresponds to the cursor position, and actually draw the
> > cursor glyph.  If vpos is incorrect, the cursor will appear in the
> > long place and will look incorrectly.
> 
> Yes, if I start GDB, and step to this line:
> 
> -->	  block_input ();
> 	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
> 
> and do
> 
> (gdb) p w->phys_cursor.vpos
> 
> I get 0.

It's definitely not what I see here.  I see the value that is the
screen line number of the cursor.  If the cursor is on the first
screen line, the value is indeed zero (VPOS is zero-based), but not in
general.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:37:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 09:36:59 2021
Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSfxD-0005jn-OC
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:36:59 -0400
Received: from sonic311-23.consmr.mail.ne1.yahoo.com ([66.163.188.204]:43298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSfxC-0005jc-Fo
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:36:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632231413; bh=2ZF7V96jRDYDXU1CvhLYaCkyvGulSLtbNNxr8Lcyzb8=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=HvcvGSQYKxs/nUOXcRs3e1qAKL6l8OXEfXGDIvQwNPXfHUBmpBepj1O2o2I4VUa0oqcEMSAToql7ziELDBJcFCkjGQllIPal4ZTWb0ef6iZKdQ5m41LaIvcew2siwHMPPmyxFHnUqy2jORv/aA5YtkIuGbpt6ja++CF/fZZscfJEyVsaSdEMQC38JvrO5bqbrjkgUpF7cUOpRPSRG4+pB3R0pvMrqtVFgGzH7tZM953ILiTRI55kfsdYApeYH/YRZnTzq0AYqBG9GeHwsz2Ej9/IgJMp5LphNb2eThFumVYHff0o0K2FmpG1zsIpmBmr7yAB/A2ovc10c4g3//yIng==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632231413; bh=R0XIc+gWVViRaHYsSApUcZNpHJ9QrX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9kppHlqZa5pkWhvkuRcU59zyqHs0TRFVJf
 lNv.nC9iqzXdeduUfvupTvrTOzpcIJ3LG7maa6PEBSlFQFuFUTGDSHqjHJJiwrbmq5N9t9m.bJwv
 p9t8ec5xFJY7LhnRHodBE5zqN_1.SejRKv_ET66Bg1qYOqiyqkEkYYf.e2Hize1YagaKn.XTipLD
 EkUIyAJUudrpeO5VGShFHtUTATrRC5CEX8fx41GTlvNaxdtntzFEWUwa0QcxfzGwnxzFZxhdCXxl
 KfnqnEB1_s0RcN1DvEJ8rGfOL_jeV2OOFvX6qLd04XJ8AtGYFTIg3NukIRI1Ycu3dpC5Wo63IPD0
 ldsGupygN7jRYP1CoSF0r_c2lMM63iwGjZxGimbjS6WTfe534lXm_YZ1SYTt.WHMncpUBybPU5IW
 hHpJdsIZn2YWCSMrluXTvaUahzDCW5PB_oLeG3Cmbr7B1KnO4OPPAckBMaFYI1RKCbg0xGclbgca
 unKWrLkIkS17ibQ0XzT80l0ZpLi8b7dH7Uhrig2nERUQ9ZBIMMX0KNzdVN37Ec9l5tsuKvs0EOz0
 a0Mb8.39ssgjWb5DNtMxhOkv5GZzpCPntgxgxt2YC6D018DtYMoztE0JbVWXIRpLMbHUXB4Dvhq8
 kFBOBLMP1b03e5rjGNBc1
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic311.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 13:36:53 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 347f36ae1b3a374eadeff08751582b86; 
 Tue, 21 Sep 2021 13:36:45 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
 <83sfxyxeer.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 21:36:41 +0800
In-Reply-To: <83sfxyxeer.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Sep
 2021 16:10:36 +0300")
Message-ID: <87h7ee1252.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 715
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Are you saying the vpos is _always_ zero?  I don't see how this could
> be true, because display_and_set_cursor uses that to find the glyph
> row that corresponds to the cursor position, and actually draw the
> cursor glyph.  If vpos is incorrect, the cursor will appear in the
> long place and will look incorrectly.

Yes, if I start GDB, and step to this line:

-->	  block_input ();
	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,

and do

(gdb) p w->phys_cursor.vpos

I get 0.


Though it could have been a problem with the debugger, as I have had
problems with GDB on Solaris in the past.  I will try again tomorrow and
let you know what happens, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:11:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 09:11:02 2021
Received: from localhost ([127.0.0.1]:45369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSfY6-0002sJ-Dz
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:11:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSfY4-0002ro-RQ
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 09:11:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49284)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSfXz-0001CH-Et; Tue, 21 Sep 2021 09:10:55 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1199
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSfXl-0006Kz-Cb; Tue, 21 Sep 2021 09:10:53 -0400
Date: Tue, 21 Sep 2021 16:10:36 +0300
Message-Id: <83sfxyxeer.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87o88m14g0.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 20:46:55 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87o88m14g0.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 20:46:55 +0800
> 
> Thanks, one question though: within this block, w->phys_cursor.vpos is
> 0! How should I go about determining whether or not the cursor is inside
> `row' ATM?

Are you saying the vpos is _always_ zero?  I don't see how this could
be true, because display_and_set_cursor uses that to find the glyph
row that corresponds to the cursor position, and actually draw the
cursor glyph.  If vpos is incorrect, the cursor will appear in the
long place and will look incorrectly.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 12:47:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 08:47:11 2021
Received: from localhost ([127.0.0.1]:45214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSfB1-0001YG-MS
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 08:47:11 -0400
Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:45207)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSfB0-0001Tm-2Z
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 08:47:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632228424; bh=EK4Uon/rNdkMh3Z2FGLMoXez5ESyI9gWz4gGkfqVZEY=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=AUQllCKB8kVCyqiykodRT3MZDCavnJSVAJMm+KthskAiDmDrUuNxnnolJTUGwhgafJCAeVW62FpwlzXDz5jZgZoYv44khIR3J8FTvQQSTB/4KmiIlVt990u0nc5R/U8RIVSCKmQ/3HB0CSMD0St6i3CnGOAix2G4mRbU9Ts0YzHUI+0A0nZS1cC1HVl4uIR8gUZKc8+uJO8+YHDLwxCvORJ7P3BjtExB4QN3/EdRvVAEgRVRm8Vmcv0IQlPDl0SDN6isoPINgqSeTGkHvzKjcCA1IiwP+NRCchNfz0sd4hnP/MUI6/hWimTUTVuI9TNK36zBywwPpDr4qI1hLOlghg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632228424; bh=zvdcHaS93oko3zDpfdxaZ2/FKhQghzA/AWGtiqWtAZB=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=LPt/6YMJzuwGI6xrV7EZs8edKZRJYABZ3QYuOtDlnQBFag45CUE9WCJQX4o6mMWaMFJmA9v68BTKZ9L77VK++gBhD1PAe9wC+TiolSohj/HfJI/Jhiw354Vcq61kOiK11Scf2gXps83G3WnlpsHWQYGbHQ5lC3SV6IBsTcMR+d/wv/Vjw3nESAsdPS+eDtMOUR14XAU/KOppQQ+E7EGplExb5HwKMZdvtST5cT+WZWbFUl8/HcZge0lxZRIXyAOZXNJZkC8njZwd7K4ftyl476uOJyh6w5st85DkeL0J/avdgkNJkIPB9X1uRPpDcsdfQAm2exClxmDpSZEwGdL5dA==
X-YMail-OSG: Do0luvcVM1krnlvKWPeJM4tD6HIBFCVNqne65fe3MDgbNJPJqffosfUnglad1J7
 1DV4aXCTwcShI5Tw1xTGBrOsP3OBvAeY7trsrUU1Nl9kCPGa1lvAEwX7kNPEx4fAdDZmituZJ7HH
 OiYJYQaTmotP8YwuS2QihvHonmq78OSTPcCgmn2._owXYfW96UsLpzFSWsRXYe0hYAtJI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tKnllhDspBOF9WfQuq46SQpSNLgpMIeBwgjjnY9adLlBh5I7_rv8
 9iGPAZE_vVv.lL93ysbmH
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 12:47:04 +0000
Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID f71bcba5b9fe9b42af312914d8836f39; 
 Tue, 21 Sep 2021 12:47:00 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 20:46:55 +0800
In-Reply-To: <83sfxz1pw0.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 13:51:27 +0300")
Message-ID: <87o88m14g0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1131
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Specifically, I now think the adjustment should happen in this
> fragment from show_mouse_face, before we call display_and_set_cursor:
>
> 	/* When we've written over the cursor, arrange for it to
> 	   be displayed again.  */
> 	if (FRAME_WINDOW_P (f)
> 	    && phys_cursor_on_p && !w->phys_cursor_on_p)
> 	  {
>   #ifdef HAVE_WINDOW_SYSTEM
> 	    int hpos = w->phys_cursor.hpos;
>
> 	    /* When the window is hscrolled, cursor hpos can legitimately be
> 	       out of bounds, but we draw the cursor at the corresponding
> 	       window margin in that case.  */
> 	    if (!row->reversed_p && hpos < 0)
> 	      hpos = 0;
> 	    if (row->reversed_p && hpos >= row->used[TEXT_AREA])
> 	      hpos = row->used[TEXT_AREA] - 1;
>
> 	    block_input ();
> 	    display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
> 				    w->phys_cursor.x, w->phys_cursor.y);
> 	    unblock_input ();
>   #endif	/* HAVE_WINDOW_SYSTEM */
> 	  }

Thanks, one question though: within this block, w->phys_cursor.vpos is
0! How should I go about determining whether or not the cursor is inside
`row' ATM?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 12:26:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 08:26:38 2021
Received: from localhost ([127.0.0.1]:45169 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSer7-0007lQ-VN
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 08:26:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45896)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSer6-0007lD-9m
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 08:26:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47686)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSer0-00027V-Uy; Tue, 21 Sep 2021 08:26:30 -0400
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 <eliz@HIDDEN>)
 id 1mSeqw-0004Mp-CA; Tue, 21 Sep 2021 08:26:30 -0400
Date: Tue, 21 Sep 2021 15:26:19 +0300
Message-Id: <83y27qxggk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: luangruo@HIDDEN
In-Reply-To: <83a6k6yzvr.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 21
 Sep 2021 13:41:28 +0300)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN> <874kae2skg.fsf@HIDDEN>
 <83ee9iz2tm.fsf@HIDDEN> <87wnna1cu6.fsf@HIDDEN> <83bl4mz0yx.fsf@HIDDEN>
 <83a6k6yzvr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 21 Sep 2021 13:41:28 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: luangruo@HIDDEN, larsi@HIDDEN, 50660 <at> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 10:41:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 06:41:47 2021
Received: from localhost ([127.0.0.1]:45051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSdDf-0000UT-J7
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 06:41:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47994)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSdDa-0000UA-BT
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 06:41:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45242)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSdDV-00031k-1e; Tue, 21 Sep 2021 06:41:37 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3781
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSdDT-0002QT-SM; Tue, 21 Sep 2021 06:41:36 -0400
Date: Tue, 21 Sep 2021 13:41:28 +0300
Message-Id: <83a6k6yzvr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <83bl4mz0yx.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 21
 Sep 2021 13:17:58 +0300)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN> <874kae2skg.fsf@HIDDEN>
 <83ee9iz2tm.fsf@HIDDEN> <87wnna1cu6.fsf@HIDDEN> <83bl4mz0yx.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: luangruo@HIDDEN, larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 21 Sep 2021 13:17:58 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
> 
> > From: Po Lu <luangruo@HIDDEN>
> > Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> > Date: Tue, 21 Sep 2021 17:45:37 +0800
> > 
> > So even if I move the cursor into the middle of the box, it will
> > still be in the wrong location, but when the cursor is moved,
> > show_mouse_face is not called, so I think putting the correction is
> > show_mouse_face is not the solution to this problem.
> 
> We could identify this situation and call show_mouse_face forcibly,
> e.g. in gui_update_window_end or some such place.

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.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 10:18:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 06:18:14 2021
Received: from localhost ([127.0.0.1]:45025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mScqs-000886-0i
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 06:18:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43346)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mScqq-00087t-LU
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 06:18:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44640)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mScqk-00007O-R6; Tue, 21 Sep 2021 06:18:07 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2352
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mScqk-0005ys-CE; Tue, 21 Sep 2021 06:18:06 -0400
Date: Tue, 21 Sep 2021 13:17:58 +0300
Message-Id: <83bl4mz0yx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87wnna1cu6.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 17:45:37 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN> <874kae2skg.fsf@HIDDEN>
 <83ee9iz2tm.fsf@HIDDEN> <87wnna1cu6.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 17:45:37 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Only the characters at the beginning and end of the box jump, so they
> > are the only ones that need an additional adjustment.  Right?
> 
> Yeah, they are the only characters causing the jump, but the effect of
> that jump "ripples", in a way, throughout the entire box.

It ripples only once, when the mouse-highlight is applied, and at that
time show_mouse_face will be called.  After the mouse-highlight is
applied, if you just move the cursor (NOT the mouse pointer), the only
part of the text that changes are the two edge characters.

> So even if I move the cursor into the middle of the box, it will
> still be in the wrong location, but when the cursor is moved,
> show_mouse_face is not called, so I think putting the correction is
> show_mouse_face is not the solution to this problem.

We could identify this situation and call show_mouse_face forcibly,
e.g. in gui_update_window_end or some such place.

It's also fine with me to do it where you wanted, as long as you can
resolve the problems with that which I mentioned earlier.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:45:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 05:45:54 2021
Received: from localhost ([127.0.0.1]:44969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mScLa-0002qF-Hv
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:45:54 -0400
Received: from sonic303-20.consmr.mail.ne1.yahoo.com ([66.163.188.146]:45445)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mScLZ-0002q2-Dj
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:45:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632217548; bh=+94ukTuLy+XzUV3ERrQbOOBPUhHVeMIVQKTgslWTmPg=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=uN0GTBatSisJsBV4BeNMztI9OlhC5YmITR3QA5iwu9hzvLBqkCAjsDM4qttNED83vzbKmlJguHUODUXjsMRkC/tiubOBQtiGih3jsetsubTj6Edky2rFS2LMOshJr1usaggny8q8rF5WPy3rQqB78efpwpn9Cz/NCddmBJvXfW0X/x7uJK2uUgSs53SCO98FqAg97DNMBF6WXBxCamV+nv3/YBdlMZfcRJNF/XEuVo6hm2ufWMr3fPFgJb3gqaFI9Vnlp/GusUxZgRCOGaNWDoNsCdB6fenQrpavhrgyrWtpuZqvJqI/lTF3O5YkXYfj1kt8e9Z1YQ4yYS1SRQOHtg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632217548; bh=sG3bpNbUlNE7Qc8T4Ic7waKrh8aG0E3Umfz4fhYbOcl=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=pK7aJQdm53xb2RGwzzUtLhiiHd2Irv4FDS7iDbt7rJELDfhAArHkxli5fhIOA57ezCdj5Qkg3HNkS/AvdNMG7mYhamBOHno2ok/3Q1kSU4Fxb02djCSzV56S9pYqVvIU+VTiJToSz3azXKoSFbktjtq9hYLG38/BkmhyzlcbtzIQ8Zg6TQ4GqpXayf+LdtVaBfNO/wlTyYN2Emw24ZjEjTwQQO+kzqk14aQ3v9+GFQEW+R7rU+rwHhJyGNDwsvvtGFNcL1/A+sVrGr5/wS5dj86RXzMoW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wQIGFd8kqKNjkaIs5t2v6tCNJPWSPjeNccYGQlsJzI4oRwm_gW3FXXPnKiJDPRU34XEyqOFSM
 kESRr.rY18JA1Nw4_5eGxzPpssu2zSjVkLFkixBm43OwWoqrtmbvB_KTga5Oig6vxesBmftqZx9z
 5r.vADXUvq57BxKnVXphssF.KjqJ8U.x.6iz5KNR__KoyimwgpaC6U91T6tQvp7fREKCYPom04qt
 A2_uIcDlhw_uCrCRKiK9kWXbmL91Rtfvd1Poe45Px08daJidT81.jgX0PHH7Jbb1_orWyzgEgZl8
 v6g39OCF9NfKp5vC5cg--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic303.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 09:45:48 +0000
Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 6875c30ee100836f45ba560b2e3c0739; 
 Tue, 21 Sep 2021 09:45:42 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN> <874kae2skg.fsf@HIDDEN>
 <83ee9iz2tm.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 17:45:37 +0800
In-Reply-To: <83ee9iz2tm.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Sep
 2021 12:37:57 +0300")
Message-ID: <87wnna1cu6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 562
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Only the characters at the beginning and end of the box jump, so they
> are the only ones that need an additional adjustment.  Right?

Yeah, they are the only characters causing the jump, but the effect of
that jump "ripples", in a way, throughout the entire box.  So even if I
move the cursor into the middle of the box, it will still be in the
wrong location, but when the cursor is moved, show_mouse_face is not
called, so I think putting the correction is show_mouse_face is not the
solution to this problem.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:38:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 05:38:12 2021
Received: from localhost ([127.0.0.1]:44951 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mScE8-0002bp-25
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:38:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36342)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mScE6-0002be-TM
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:38:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:41898)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mScE1-0008BF-79; Tue, 21 Sep 2021 05:38:05 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3889
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mScE0-0008Fu-QB; Tue, 21 Sep 2021 05:38:05 -0400
Date: Tue, 21 Sep 2021 12:37:57 +0300
Message-Id: <83ee9iz2tm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <874kae2skg.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 17:20:31 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN> <874kae2skg.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 17:20:31 +0800
> 
> Yes, starting from emacs -Q, create a buffer in fundamental-mode, and
> evaluate:
> 
>   (insert (propertize "some sample text" 'face '(:box 10) 'mouse-face 'highlight))
> 
> Highlight the text that was inserted, and move the cursor around inside
> the highlighted area.  The text will begin to jump all over the place.

Only the characters at the beginning and end of the box jump, so they
are the only ones that need an additional adjustment.  Right?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:20:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 05:20:48 2021
Received: from localhost ([127.0.0.1]:44898 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSbxI-00022m-E7
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:20:48 -0400
Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:36644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSbxG-00022W-Rs
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 05:20:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632216040; bh=ozTRJXe3dD1Nr+t+lw+u48D4H5B8117PyArBJqWn/T4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=ZhXn7EFNlaU/7/yRxd5I4mEhLZHlj2DDg1FP+qLKQNPxZyS7PM2vjws7c4p5XuHz/Ugnl/yxGWRNGY9mDQbceC+3IbE1aQ/BY8l14+YRPacOGvHBdpPgc4/8GP56QR/PSnAKPvpMzlaBFCZlg+OgaGP49aHSHJHig/IlJQlG78qst6KiFtRPIjHZUItoQpUvYpNO3zCLUdkK6AXfAdIZmfHf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U4KPUycI.d3mJFdnMUzdNqtL
 2xWjIFSCYmwPGtBM96wpl4zyfon3NYvK1kPWBqhr1RWkdFJV3qbWy5_JOdk6RWe.qaJDkTmmzq7D
 XYPntydV_yfE8gMIT.l5sUuR63YdXTviz2xewYzjZv4tpaTUa1lhJUqikT0beutojTXENQxF0i8r
 2MMNM6babJ_HbCi8kLytYJra1JCql6dh3_ekOL1vxsHJ0lWCqdkim1DSU4jQTnWLaKUw_GpDRVEf
 QXH4OCBS8asEqz4PFPuPLvuubY6xWb4xSmA397XXYgucMFpJsrsARbNLcHRPxB5_ZjG6eEuEF57b
 KacVO0sPIm8ZZL8gJuzL2UbKTQgB4.F2VWvYQ_UEBSxG.QvY9.EaLsgeywFRkrO6n66IxHTOQcBf
 bdE0KmaWqZ9z5Cgqto7RppJYRonUiIhjqBb4XlI44Gy.ozGm7.KVoKXvlJ1zG5Y7waDk0AuqQigj
 41BZAgJS9nHh5uzF8K42AJKC1INBIVBoumbEE8Kw3b6F35iZjsXbLg_7JG9HWju9G6vQLj5mp5ev
 uLuppvbFmwwvKVMoJR2lMH8Ibqt5mmdI640ML.miBn.YM45vSwQNQjEoxFNUjyB8z_gQtr8N7xLn
 Up7wmWgzkKmUqNT72SSPWyCuAJeSDOu7po8fz0QAHk4iHdg1tbJFr08WBH3AkhZMjSvXScsRPdEk
 7cLtRt03XKIvaOU19KuzbBUblEOyWhNAs04m53.hO2iYwaFInbrHZ5GjUHG0Fn6mZ.OW.ZdqS8ei
 0xLC.SRjs_qjCtm6ZhTeIge1qHbmieteB.2FZ76ExaohWjGZ2l2wthTdui2nGfwy.vbuzI4M4y4G
 TQOT0gXd6KQ0fFyS5
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic305.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 09:20:40 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 02eebe5437c71ec8a1d6467ead54af8c; 
 Tue, 21 Sep 2021 09:20:34 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
 <83pmt2z593.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 17:20:31 +0800
In-Reply-To: <83pmt2z593.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Sep
 2021 11:45:28 +0300")
Message-ID: <874kae2skg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 552
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Do you see any display problems with the glyph under the cursor if you
> just move the cursor inside the mouse-highlighted region?  If so, can
> you show the recipe for reproducing the problem?

Yes, starting from emacs -Q, create a buffer in fundamental-mode, and
evaluate:

  (insert (propertize "some sample text" 'face '(:box 10) 'mouse-face 'highlight))

Highlight the text that was inserted, and move the cursor around inside
the highlighted area.  The text will begin to jump all over the place.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 08:45:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 04:45:48 2021
Received: from localhost ([127.0.0.1]:44862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSbPQ-000128-8c
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 04:45:48 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54670)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSbPO-00011u-RS
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 04:45:47 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34252)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSbPH-0005FN-CX; Tue, 21 Sep 2021 04:45:39 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4661
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSbPF-0006gJ-9X; Tue, 21 Sep 2021 04:45:39 -0400
Date: Tue, 21 Sep 2021 11:45:28 +0300
Message-Id: <83pmt2z593.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87a6k62xgn.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 15:34:48 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN> <87a6k62xgn.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 15:34:48 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > When the cursor moves, w->phys_cursor.x is recomputed.  AFAIR, in this
> > case we perform the usual redisplay (which updates w->phys_cursor),
> > and then reapply mouse-face, so show_mouse_face should be called
> > again.  But you can easily establish if I'm right by running Emacs in
> > a debugger with a breakpoint in show_mouse_face.  Let me know if you
> > find something unexpected or need help in interpreting the findings.
> 
> Interestingly enough, I don't see show_mouse_face being called when the
> cursor moves within the highlighted area; I only see it called when the
> highlight itself changes, such as when the mouse pointer moves into the
> mouse face.

If show_mouse_face is not called, then there's nothing to be adjusted.
Do you see any display problems with the glyph under the cursor if you
just move the cursor inside the mouse-highlighted region?  If so, can
you show the recipe for reproducing the problem?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 07:35:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 03:35:08 2021
Received: from localhost ([127.0.0.1]:44744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSaJ1-0005Gs-Qh
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 03:35:08 -0400
Received: from sonic309-22.consmr.mail.ne1.yahoo.com ([66.163.184.148]:45514)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSaIv-0005GB-PV
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 03:35:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632209696; bh=m6fbchAJvXLIofYxeIWWciHCegTJ3ScNYUwgFGLvSHk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=hGsGOlxBUkwGtjnOXBrWLF1WkxBxRwPcPxOA3PhYmHrT+jLEmS+ii9eDnI6LXy49OpMMh1bhtgYxS8TlCA3xpC5OpRB+7pNud1eJMtHj9P6FSyaZ4SyDnE6x5SFH+Hy1q/2jS906g006s0eivV1UarnTZU+MpG2r57JlxG9bqbiXEodNdqGdTMsFAluCyRL7YoqJGIhP+A8CsJ5fa9qY/nPwoDTxO9C0quMGrtSh+VaYP1VCiHIY7n69AGXd2KHCtxnnUy7fAxiE1m0bRJMhi6TRO1fZLHAF3Wl90QuyDJvovsGSrsVUdBNBMI1BPbyA0CEfeCGdwwOB/93WdV1N5g==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632209696; bh=l3a1pbOkMHb1yJ3DRiQ4weUzVNe5bij8O+cMRCG5hg6=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=tDSf3KpLXvrHu0HUktupWSCuQm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ksFZmy.7Ag5x_8Hq8VI
 P.JhP1dZFVjTODRQy1ihpSQzO7JJIHXXN5j7H8JZ7glD2LzVCIBXW4Uzom9mnwvQAOXPwBnj_5Jl
 5G7kKB_Exu8yApjGJBkuMB8wbME0R9TPvtpLGxlLs.tfJ6SCf46ZrNNEf2Bt6sMxhiDUEyf6B2ol
 yyKC0..vXz1ixQAr8MKQLxtDn0p5RU8KD70KFVU1TDwlVBdMM6CB1vEA2RStYlysyJDRR40_usFX
 .co3y5189s1WtE5jqlKRSSnRqOUhFNbEi6PwbLxyBtK5RzS4weGOdQXFTAxigsivNr.zSo0KDaUk
 CgwuWVkySsDPT0MbCSDXYQ5k7YYVzjbXeUDt0e9LcbNCbZ9prdvNsiuV5uo88U4wyboBtN_fxzcO
 O17hjdVxGo_xF2FjH6SFiAm4ZCZ0rkMRuBdl0keCDPQj1hQVvEZW6u0pQxSY_pASRVRlHSldn7W6
 tin2J6xFWBwx4mii.WaUv.DiY9LPZPqiTOC9.aT4JbWqwkpvGZYvC4mCjmieWWbaBcKxLF1e7Fb7
 uEdf3EEzoaITQ9LZa
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic309.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 07:34:56 +0000
Received: by kubenode514.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 38cca86377cf9b63ce495ce402ae59ab; 
 Tue, 21 Sep 2021 07:34:51 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
 <8335py1mqm.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 15:34:48 +0800
In-Reply-To: <8335py1mqm.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Sep
 2021 09:11:45 +0300")
Message-ID: <87a6k62xgn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 845
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> When the cursor moves, w->phys_cursor.x is recomputed.  AFAIR, in this
> case we perform the usual redisplay (which updates w->phys_cursor),
> and then reapply mouse-face, so show_mouse_face should be called
> again.  But you can easily establish if I'm right by running Emacs in
> a debugger with a breakpoint in show_mouse_face.  Let me know if you
> find something unexpected or need help in interpreting the findings.

Interestingly enough, I don't see show_mouse_face being called when the
cursor moves within the highlighted area; I only see it called when the
highlight itself changes, such as when the mouse pointer moves into the
mouse face.

Let me know if you need any more information from me to debugging this;
I will probably be unable to debug this myself for the next day or two.

Thanks!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 06:11:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 02:11:58 2021
Received: from localhost ([127.0.0.1]:44684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSZ0Y-0002vk-Na
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 02:11:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSZ0X-0002vW-3m
 for 50660 <at> debbugs.gnu.org; Tue, 21 Sep 2021 02:11:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59192)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSZ0R-0000lf-OF; Tue, 21 Sep 2021 02:11:51 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3039
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSZ0R-0005Fl-Av; Tue, 21 Sep 2021 02:11:51 -0400
Date: Tue, 21 Sep 2021 09:11:45 +0300
Message-Id: <8335py1mqm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87pmt23gqg.fsf@HIDDEN> (message from Po Lu on Tue, 21 Sep
 2021 08:38:31 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN> <87pmt23gqg.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Tue, 21 Sep 2021 08:38:31 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > One other problem with this implementation is that the additional code
> > will run when the mouse-highlight is removed as well, in which case we
> > know that no adjustment is needed for w->phys_cursor.x.
> 
> Interesting.  What if the cursor is moved while it is inside mouse face
> though, if the adjustment is done in show_mouse_face? Won't it only
> apply to the cursor when the mouse face is first shown, and not
> necessarily when changes happen to the position of the cursor later?

When the cursor moves, w->phys_cursor.x is recomputed.  AFAIR, in this
case we perform the usual redisplay (which updates w->phys_cursor),
and then reapply mouse-face, so show_mouse_face should be called
again.  But you can easily establish if I'm right by running Emacs in
a debugger with a breakpoint in show_mouse_face.  Let me know if you
find something unexpected or need help in interpreting the findings.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 00:38:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 20:38:46 2021
Received: from localhost ([127.0.0.1]:44337 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSTo5-00050S-PM
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 20:38:45 -0400
Received: from sonic307-10.consmr.mail.ne1.yahoo.com ([66.163.190.33]:34170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSTo3-000509-Oj
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 20:38:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632184718; bh=kOCPNEq4KI2QIZ7UtDPYEt9wp5pWbtz3uL3qzB2VXuQ=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=nf+5ZSp8GwDSTwjhYB8GUFckBBrsm6qZ5TqcNC7abtxK8hH5vd8/PbhOPVO2s0heP74b+slUrkKtM6/gJY9TM7zqI238jFBxijDZSTB40k5cVFdzxQyBcJCUQqfyw3BmGiddOsQNEqwfRKPCoSZlhYj+704RzsNeOJqUiIWBfIF0hayTR7OZvWvuRAzWq2DomE7XXCmvlKhLLGceEWf3wRFQKpIzAFtgbnnX29B1HR1osw4WF75C8DmAj134IvfRMO1RB4fdvdjlYLBLlyQsX1Auzm4q0yfOJhJDG85KvtKxrqkoLEKgNgM1YmTaoz8NSdtRcq9If2AQ8adVQ7BjgA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632184718; bh=+G/HgUC0sL3ZBPylPu8DAsrfdhwByVA6nYdFlRF8+bj=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=JDfFgKk90b/GvqzPqYhDeD9olyLOINHWiGbDo1109uP+HGb7qkQY3nPAKIBc7jk0Cx6jLztaWed8d7zKnxSTvQh41sTkkiTP8uhwLymIEIU1fUfr+m1F6jXCCDVkC/c+XPFo6Vxxae5CH1AYlplJym69U70CnVIlk2teXnvALaH1bE8vTISbIiFLhSuOqyCKcGFrfGL/qgD/FGr8Df98gs6BWe+6wXdRzf4pMNdJ42k/M0SPgbZZFD+od5Z7F1cge8SGCdcFx8gMC5OYJAuSe1r8TfdDWR5Fvk6Y20N/N+uHgNoIhdZqtvUHZ3WvnnLpOgMlwsPxGRdKI4+AGPBcJQ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PthDyrgi.eKILF_
 f9bXUJ00UHsVDVPaPOFPuflwxi.66q8X8aH.GLc5eoDVGDp2PqXORR7qXqlx7l51LYxGkgEErvaI
 i4_Y697MIHAb91MX1IsUpXh.Iqxs_mua61UIa1BBgLvVzP1iv71TIGUEftLPnGUM3UI_F0K5KOh_
 0g54H.Jj3_nEY7ewf2H2Rj4HieDbzQyQ.xKYmoK1qL6sK70isM_PZVxieUmfINFdGQCK.xzdda9q
 hxvT7lXr.gj6n_RiehHsEhA--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic307.consmr.mail.ne1.yahoo.com with HTTP; Tue, 21 Sep 2021 00:38:38 +0000
Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 20b1a0a449ed1161bd12ef311e2f905e; 
 Tue, 21 Sep 2021 00:38:35 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
 <83o88n1l1f.fsf@HIDDEN>
Date: Tue, 21 Sep 2021 08:38:31 +0800
In-Reply-To: <83o88n1l1f.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 15:36:12 +0300")
Message-ID: <87pmt23gqg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 525
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> One other problem with this implementation is that the additional code
> will run when the mouse-highlight is removed as well, in which case we
> know that no adjustment is needed for w->phys_cursor.x.

Interesting.  What if the cursor is moved while it is inside mouse face
though, if the adjustment is done in show_mouse_face? Won't it only
apply to the cursor when the mouse face is first shown, and not
necessarily when changes happen to the position of the cursor later?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 12:36:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 08:36:29 2021
Received: from localhost ([127.0.0.1]:41190 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSIX7-0006fm-74
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 08:36:29 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51974)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSIX5-0006fZ-PY
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 08:36:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58262)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSIX0-00089j-I6; Mon, 20 Sep 2021 08:36:22 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2340
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSIWz-0006fR-IS; Mon, 20 Sep 2021 08:36:22 -0400
Date: Mon, 20 Sep 2021 15:36:12 +0300
Message-Id: <83o88n1l1f.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87ee9j4i8y.fsf@HIDDEN> (message from Po Lu on Mon, 20 Sep
 2021 19:08:13 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Mon, 20 Sep 2021 19:08:13 +0800
> 
> Thanks, but I already cooked something up.  The adjustment, in my case,
> is done in draw_phys_cursor_glyph, conditional on
> cursor_in_mouse_face_p.
> 
> Is there anything wrong with this approach?  Thanks.

One other problem with this implementation is that the additional code
will run when the mouse-highlight is removed as well, in which case we
know that no adjustment is needed for w->phys_cursor.x.

Also, I think it's incorrect to add mouse->box_vertical_line_width to
_every_ glyph that in the regular face has this attribute.  That's
because the entire mouse-highlighted area has just two glyphs which
could have a box line near it: the first and the last one.  So you
should only add it once.  Try this code on a screen line with several
different  stretches of characters with the box face, and arrange for
all of these stretches to be mouse-highlighted together.

Moreover, if the mouse-highlighted text takes more than one screen
line (a.k.a. "glyph row"), only the first screen line/glyph row need
to have the mouse->box_vertical_line_width added.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 12:08:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 08:08:02 2021
Received: from localhost ([127.0.0.1]:41148 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSI5a-0005yi-9X
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 08:08:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSI5Y-0005yJ-1I
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 08:08:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57476)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSI5S-0002sX-Fb; Mon, 20 Sep 2021 08:07:54 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4518
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSI5Q-0003fO-MR; Mon, 20 Sep 2021 08:07:53 -0400
Date: Mon, 20 Sep 2021 15:07:43 +0300
Message-Id: <83r1dj1mcw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87ee9j4i8y.fsf@HIDDEN> (message from Po Lu on Mon, 20 Sep
 2021 19:08:13 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN> <87ee9j4i8y.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Mon, 20 Sep 2021 19:08:13 +0800
> 
> > Specifically, I now think the adjustment should happen in this
> > fragment from show_mouse_face, before we call display_and_set_cursor:
> 
> Thanks, but I already cooked something up.  The adjustment, in my case,
> is done in draw_phys_cursor_glyph, conditional on
> cursor_in_mouse_face_p.
> 
> Is there anything wrong with this approach?  Thanks.

My worry is that draw_phys_cursor_glyph is called from many other
places as well, none of which needs this adjustment.  So we are going
to do unnecessary work, especially if the cursor happens to be inside
mouse-highlight.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 11:09:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 07:09:36 2021
Received: from localhost ([127.0.0.1]:41091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSHB2-0000E6-Ov
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 07:09:36 -0400
Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:42753)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSHB0-0000Dm-V8
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 07:09:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632136169; bh=yEOzL8VvNiSnvP70irF7yyrPpzhU9uaHSeQs9Cpbvd8=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=DHKVZQ8HounLI/hkW1aPRVZg785823kL5fSykxGhHOm2H8JMZm8YVJgzoUIrOWX18MBMK68jXrYsLDS6/rL2tCUaflg7WQJkfBxWhk9APmYkmnvhmjZoY4Iew7iEcNK4NT5fnH+xnRRbfRBNwIsZ1zlm753g8uyN/8rHQ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BM
 C_vcEqS3nn91ctEv__vzzpXZV78pvnQIBYrGblM9fVs_oQZBqwOc.y9Avs7s8SgvGiTvOlDt6ku5
 bz_C3Uywsjjxaio2pQUFv_C__D9c3349XsE3__drFzkH4wiezWPeAHgQMPqCU0EKMLB3fNhQk2bf
 FxdvM.FG2C1.W04eg2GLBN50BEKXS2IIq8clIqrc4YNUVJxdpqdZFnasuuuJATGZZmJy3_43sfrM
 a5V9..t5ZFjerrK9Ha3amizEjZt0fPdvYswZBMWbKnZZPPbMVfnoOb0XEPRNbsbTv6d3c6ixUMw2
 o.ETwxidW1elX7ZFkR4L.7JDyi4sRf6EOtIUPbX6gccMcWtsYyTh132P8l9pirtABDn7H.757g2t
 pUfFwT9j0DUdRk3yszM8CkL7lgjs4k6326CeD4rHPQ.vub3dpBe7sE7rYWcc7R8vh_rJ5zR7zUTU
 eIlKEPZPyvWc9pYVPcQKtCAQWjE8YpDfY1.6YRdNAOWvbhkg5DhHkC_QdTGBYXrULgPhu2Re0TrV
 GVIdSRaEqzbAQR4UC8mecxzj1CGlLzOW02mxAf1xsDjoEpGCP4EtRYS3AizmA.psyI64KT7kSNsL
 rnx5S_TBlnP82uRKPGgxSc1RwZmhFtclqcZsme5HZz5otz6mSReHVRUuhgj_gNFs2Yqqs5rQxj2e
 WC_K.m4DVdDRGizn7mxMlGWQYhfjWKRYxVglY.UUz.f7LY3grUjeYJTZENypX5zE4SDzZhsN.sC0
 Q9qJINL2R6wKERXdq0MMnDWA58njIm79uhXbcjsgJ9Oj3grxN7f9Cospj7dnl_z6l2slfXcxlUF7
 R8Q.EjBpAn0_CRyMeg1J5VLshRXTyfbHqW0TTgt7SaJDevpL6tndJuQkyvLupmtyFmGXcarswlFU
 uZYkh0zHzwLGk5n4IT1Q-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 11:09:29 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID e00d5da7eb79a49b50c040b7785190e7; 
 Mon, 20 Sep 2021 11:09:24 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 19:09:20 +0800
In-Reply-To: <83sfxz1pw0.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 13:51:27 +0300")
Message-ID: <87a6k74i73.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 276
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> I think you will need separate loops for reversed_p rows, where you
> should loop from the end of the row, not from the beginning.

Oops... It seems to be the case that I missed this in the patch I just
sent you.  I'll correct it ASAP.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 11:08:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 07:08:28 2021
Received: from localhost ([127.0.0.1]:41086 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSH9w-0000CA-Aw
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 07:08:28 -0400
Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:37271)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSH9u-0000By-Mf
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 07:08:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632136100; bh=fXBfKDUaznoJcoeTweXn8iqO1VFoDepHuvGU+RWUev4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=AIGmjpawR14u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.kgtD
 NqLgoNAaaXwWGIL_IvV8-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic307.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 11:08:20 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID f1b0b0d53d8622f2f83fac77c1bd6a5d; 
 Mon, 20 Sep 2021 11:08:16 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
 <83sfxz1pw0.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 19:08:13 +0800
In-Reply-To: <83sfxz1pw0.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 13:51:27 +0300")
Message-ID: <87ee9j4i8y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19043
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 3582
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

> Specifically, I now think the adjustment should happen in this
> fragment from show_mouse_face, before we call display_and_set_cursor:

Thanks, but I already cooked something up.  The adjustment, in my case,
is done in draw_phys_cursor_glyph, conditional on
cursor_in_mouse_face_p.

Is there anything wrong with this approach?  Thanks.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-cursor-position.patch

diff --git a/src/xdisp.c b/src/xdisp.c
index 2e72f6b591..ca6b98155a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -31696,7 +31696,69 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
       bool on_p = w->phys_cursor_on_p;
       int x1;
       int hpos = w->phys_cursor.hpos;
+      int mouse_off = 0;
+#ifdef HAVE_WINDOW_SYSTEM
+      if (cursor_in_mouse_face_p (w))
+	{
+	  struct frame *f = WINDOW_XFRAME (w);
+	  Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+	  struct glyph *start, *end;
+	  struct face *mouse_face = FACE_FROM_ID (f, hlinfo->mouse_face_face_id);
+	  end = &row->glyphs[TEXT_AREA][hpos];
+
+	  if (MATRIX_ROW_VPOS (row, w->current_matrix) ==
+	      hlinfo->mouse_face_beg_row)
+	    start = &row->glyphs[TEXT_AREA][hlinfo->mouse_face_beg_col];
+	  else
+	    start = row->glyphs[TEXT_AREA];
+
+	  /* Calculate an offset to correct phys_cursor x if we are
+	     drawing the cursor in the mouse face. */
+
+	  for (; start <= end; ++start)
+	    {
+	      struct glyph *g = start;
+	      struct face *mouse = mouse_face;
+	      struct face *regular_face = FACE_FROM_ID (f, g->face_id);
+
+	      bool do_left_box_p = g->left_box_line_p;
+	      bool do_right_box_p = g->right_box_line_p;
 
+	      if (row->reversed_p && g->type == IMAGE_GLYPH)
+		{
+		  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						     g->u.img_id);
+		  do_left_box_p = g->right_box_line_p &&
+		    g->slice.img.x + g->slice.img.width == img->width;
+		  do_right_box_p = g->left_box_line_p &&
+		    g->slice.img.x == 0;
+		}
+	      else if (g->type == IMAGE_GLYPH)
+		{
+		  struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						     g->u.img_id);
+		  do_left_box_p = g->left_box_line_p &&
+		    g->slice.img.x + g->slice.img.width == img->width;
+		  do_right_box_p = g->right_box_line_p &&
+		    g->slice.img.x == 0;
+		}
+
+	      /* If the glyph has a left box line, subtract it the
+		 offset. */
+	      if (do_left_box_p)
+		mouse_off -= max (0, regular_face->box_vertical_line_width);
+	      /* Likewise with the right box line, as there may be a
+		 box there as well. */
+	      if (do_right_box_p)
+		mouse_off -= max (0, regular_face->box_vertical_line_width);
+	      /* Now we add the line widths from the new face. */
+	      if (g->left_box_line_p)
+		mouse_off += max (0, mouse->box_vertical_line_width);
+	      if (g->right_box_line_p)
+	        mouse_off += max (0, mouse->box_vertical_line_width);
+	    }
+	}
+#endif
       /* When the window is hscrolled, cursor hpos can legitimately be
 	 out of bounds, but we draw the cursor at the corresponding
 	 window margin in that case.  */
@@ -31705,7 +31767,8 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
       if (row->reversed_p && hpos >= row->used[TEXT_AREA])
 	hpos = row->used[TEXT_AREA] - 1;
 
-      x1 = draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, hpos, hpos + 1,
+      x1 = draw_glyphs (w, w->phys_cursor.x + mouse_off,
+			row, TEXT_AREA, hpos, hpos + 1,
 			hl, 0);
       w->phys_cursor_on_p = on_p;
 

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 10:51:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 06:51:45 2021
Received: from localhost ([127.0.0.1]:41072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSGtl-0008Cl-Gk
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 06:51:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59754)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSGtj-0008CX-14
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 06:51:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55698)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSGtd-0006Rw-M1; Mon, 20 Sep 2021 06:51:37 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3854
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSGtd-0007CN-9L; Mon, 20 Sep 2021 06:51:37 -0400
Date: Mon, 20 Sep 2021 13:51:27 +0300
Message-Id: <83sfxz1pw0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87k0jb4k5l.fsf@HIDDEN> (message from Po Lu on Mon, 20 Sep
 2021 18:27:02 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN> <87k0jb4k5l.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Mon, 20 Sep 2021 18:27:02 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > So I think all that's needed is to adjust the value of
> > w->phys_cursor.x, when needed, in draw_phys_cursor_glyph, before
> > passing it to draw_glyphs, or perhaps in its callers.  The value of
> > w->phys_cursor.x should stay unaltered, but what we pass to
> > draw_glyphs should be offset if needed.
> 
> Thanks, I'll work on that.

Specifically, I now think the adjustment should happen in this
fragment from show_mouse_face, before we call display_and_set_cursor:

	/* When we've written over the cursor, arrange for it to
	   be displayed again.  */
	if (FRAME_WINDOW_P (f)
	    && phys_cursor_on_p && !w->phys_cursor_on_p)
	  {
  #ifdef HAVE_WINDOW_SYSTEM
	    int hpos = w->phys_cursor.hpos;

	    /* When the window is hscrolled, cursor hpos can legitimately be
	       out of bounds, but we draw the cursor at the corresponding
	       window margin in that case.  */
	    if (!row->reversed_p && hpos < 0)
	      hpos = 0;
	    if (row->reversed_p && hpos >= row->used[TEXT_AREA])
	      hpos = row->used[TEXT_AREA] - 1;

	    block_input ();
	    display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
				    w->phys_cursor.x, w->phys_cursor.y);
	    unblock_input ();
  #endif	/* HAVE_WINDOW_SYSTEM */
	  }

Here we know that if the DRAW argument is DRAW_MOUSE_FACE, we are
displaying the mouse-face, and if it's DRAW_NORMAL_TEXT, we are
removing the mouse face.  We can also know which glyphs are being
redisplayed with/without the mouse highlight, see the loop above that
calculates start_hpos and end_hpos (you can save aside the results
when it does that for the cursor row).  The glyphs in the glyph row
have their original face_id (Not the mouse-face ID!), so you can look
at their left_box_line_p and right_box_line_p attributes, the
face->box attribute, etc.  And the corresponding attributes of the
mouse-face can be accessed via mouse_face_face_id etc.

So you should be able to walk the glyphs from the beginning of the
redrawn area to the cursor glyph and calculate the offset for
w->phys_cursor.x you need.  I think you will need separate loops for
reversed_p rows, where you should loop from the end of the row, not
from the beginning.

A separate function to compute the offset will probably be best.

> > The correct place to fix this is therefore somewhere under
> > note_mouse_highlight, which is where we handle redrawing of the
> > mouse-sensitive face, including the cursor.
> 
> Thanks, I've learned a lot.  I hope I haven't been inconveniencing you
> in any way.

No, not at all.  Thank you for working on this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 10:27:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 06:27:19 2021
Received: from localhost ([127.0.0.1]:41038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSGW7-0005RQ-5I
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 06:27:19 -0400
Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:41564)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSGW4-0005RA-98
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 06:27:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632133630; bh=Jx+OG1Rig74tM4cjAWmtV+a4KPuCFkKVrCddyrU2KKs=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=PfWdpw/h376AHiLhx5009jnYHurpRgy6bkTuwmGytwONu80F0LyWfRTHQY7/QUDOs4xkmWuInYlfket4yLKUi/9HPiB/DvCW2MPPrsLx5ZedwJ6pW6hBK0QotgVkILWZ+rb75LFecpJmbjBSngdSwqatwTw4EYUdIMwnD4YBe/voJemDgIIAaRspyIK9Q+ISmXOhH93hSO1Y4Uu04zlfmxYHBPbNBEmDWf+esVzlinaFixNfn3uK0SFNCgZyFJyYjpeyROenOicxXyRUejRY7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ADebdSGes8YLwsmtyD4ZCM3nYFfZyaJ_Axw7edpbxZeY1zA
 RjmKthbDluF221vayGCNL.rak3xWIZzqA6KqntLaL99iDLoLGuz8pKzHKQ8Nft5iBAo6wDcudvvq
 IZsmS9f4tPPBqyYQl51Xw8nVBOU3eZZtjGexvfEAs2ppaX9vWmUJvfaMNB0JSWV66Rr7E00xlWtS
 uqxR6RLckMI5uLQIQt.KFWY4_wz6pc.SK0VpYkDb5PzfxDznUxyASSxSVQagtj6g3.JrdQAXJxK_
 KDUEHzb3elkU2hWr4C_d4t2Ds_R94NOGBebSjwCxR3NQJMl_s8wM9kvDU5u_t9Tb7CX6Flzr63bm
 pqilJ_TbiQ.4K4NAQxgulHXTCThNuNjGNYjpZWB2f._swo4.fP0n_TRf740sgJlRRWmYjgDAYhGH
 28AKY6XWKjjBvE7hPNgfnk04qnzR21A4ZAxWSwstxSwpOSIzB6obPf3XxB22qI.IFTb5Kys3xoRX
 EgCcbqfayu_sGWLvgFM4brYoOeQHpIFGXaS1zrrSNAdPZOW8n3DWU8hdh4tUfShW5nfR6Kvljtf5
 Hvow5Y6ZsEKPhLVq5F9StZmK6zcQL0dNPSLbWy1Exc0geQVzuCIFaX5NG23YyRFGX_87I.x1wNng
 6gXgU6j6zPbBIqbAIC.OAbKAdNz6UIGPPUkaEXkuzXEe5VemyuObDXxirV99NyC0LewqmVJrP6Qo
 CcCeq6k_PtMrzcx.wIPpCVhdwXx_O6ZcreIN69p_IM6xBWHJtaZkarMCbg3LKZJxLDpSEAaAtydu
 jP0supI7wpd2YF2cO
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic305.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 10:27:10 +0000
Received: by kubenode512.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID bbe6dfce5d011ae05127c9d1d1c4305c; 
 Mon, 20 Sep 2021 10:27:06 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
 <83zgs71su7.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 18:27:02 +0800
In-Reply-To: <83zgs71su7.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 12:47:44 +0300")
Message-ID: <87k0jb4k5l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1609
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> So I think all that's needed is to adjust the value of
> w->phys_cursor.x, when needed, in draw_phys_cursor_glyph, before
> passing it to draw_glyphs, or perhaps in its callers.  The value of
> w->phys_cursor.x should stay unaltered, but what we pass to
> draw_glyphs should be offset if needed.

Thanks, I'll work on that.

> The glyph row doesn't store any dimensions, it only stores the
> pixel_width of each glyph and the starting X-coordinate of the row.
> So where the mouse face is drawn, we don't need any updating.

> The cursor position of a window, stored in w->phys_cursor, is
> calculated when the cursor is moved.  It is never recalculated
> thereafter, until point is moved again.  In particular, displaying
> mouse-sensitive text in mouse-face just reuses the glyphs already
> produced, it doesn't recalculate them.  But since we always redraw the
> entire sequence of glyphs in the mouse face or in the box face, the
> glyphs gets moved horizontally because we see the first glyph with the
> box and handle that accordingly.  But when we then redraw the cursor,
> we reuse the information in w->phys_cursor, which is slightly off when
> the box attributes of the mouse face is different from that of the
> "regular" face.  This is what causes the cursor glyph be drawn in the
> wrong location.

> The correct place to fix this is therefore somewhere under
> note_mouse_highlight, which is where we handle redrawing of the
> mouse-sensitive face, including the cursor.

Thanks, I've learned a lot.  I hope I haven't been inconveniencing you
in any way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 09:48:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 05:48:03 2021
Received: from localhost ([127.0.0.1]:41016 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSFu6-0004NP-PA
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 05:48:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49328)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSFu4-0004Mv-D4
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 05:48:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54614)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSFtz-0002lw-1w; Mon, 20 Sep 2021 05:47:55 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3934
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSFty-0008Ib-GR; Mon, 20 Sep 2021 05:47:54 -0400
Date: Mon, 20 Sep 2021 12:47:44 +0300
Message-Id: <83zgs71su7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87r1dj4q4m.fsf@HIDDEN> (message from Po Lu on Mon, 20 Sep
 2021 16:18:01 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN> <87r1dj4q4m.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Mon, 20 Sep 2021 16:18:01 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Actually, it looks like we already do everything we need to account
> > for the box border, when it exists, while drawing the glyphs (in
> > xterm.c/w32term.c).  The pixel_width of the glyphs is not used by the
> > back-end code which actually draws to the glass.  So the only place
> > which needs fixing is probably draw_phys_cursor_glyph and maybe also
> > erase_phys_cursor.  Assuming we are indeed talking about problems with
> > the glyph under the cursor.
> 
> My understanding is that when the cursor is drawn, the string in
> RIF->draw_glyph_string contains _only_ the glyph underneath the cursor,

That is correct.

> while the terminals only compensate for the box if the first glyph in
> the string has a left box line; when drawing a cursor on the area with a
> mouse face, that is only true if the cursor lands on the start of the
> box.

Also correct.  But the cursor glyph that is not the first or last of
the box area doesn't need any compensation, it just needs to be drawn
at the correct X-coordinate.

So I think all that's needed is to adjust the value of
w->phys_cursor.x, when needed, in draw_phys_cursor_glyph, before
passing it to draw_glyphs, or perhaps in its callers.  The value of
w->phys_cursor.x should stay unaltered, but what we pass to
draw_glyphs should be offset if needed.

If you think this will not be enough, what else is needed, and why?

> In addition to that, draw_phys_cursor_glyph uses the value
> w->output_cursor.x as the X offset passed to draw_glyphs, so I still
> don't think the problem lies in draw_phys_cursor_glyph, but either in
> where the cursor position is calculated (by tallying up the
> pixel_widths), or where the mouse face is drawn without updating the
> contents of the glyph row to reflect the potentially changed dimensions.

The glyph row doesn't store any dimensions, it only stores the
pixel_width of each glyph and the starting X-coordinate of the row.
So where the mouse face is drawn, we don't need any updating.

> Personally, I still think the problem lies in the latter area and not
> the former, but I'll leave that up to your judgement.

The cursor position of a window, stored in w->phys_cursor, is
calculated when the cursor is moved.  It is never recalculated
thereafter, until point is moved again.  In particular, displaying
mouse-sensitive text in mouse-face just reuses the glyphs already
produced, it doesn't recalculate them.  But since we always redraw the
entire sequence of glyphs in the mouse face or in the box face, the
glyphs gets moved horizontally because we see the first glyph with the
box and handle that accordingly.  But when we then redraw the cursor,
we reuse the information in w->phys_cursor, which is slightly off when
the box attributes of the mouse face is different from that of the
"regular" face.  This is what causes the cursor glyph be drawn in the
wrong location.

The correct place to fix this is therefore somewhere under
note_mouse_highlight, which is where we handle redrawing of the
mouse-sensitive face, including the cursor.

> BTW, in x_set_cursor_gc, I notice that s->face isn't being set to the
> mouse face even when the cursor lies inside the mouse face.  Perhaps
> checking for cursor_in_mouse_face_p (s->w), and setting s->face to the
> mouse face when that is the case would be prudent?  AFAIK, something
> similar is already being done in x_draw_stretch_glyph_string (see this
> chunk of code):
> 
> 	  if (s->row->mouse_face_p
> 	      && cursor_in_mouse_face_p (s->w))
> 	    {
> 	      x_set_mouse_face_gc (s);
> 	      gc = s->gc;
> 	    }

x_draw_stretch_glyph_string does that only if needs to clear an area
that is wider than the width of the frame's default font, which cannot
happen in our case.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:18:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 04:18:17 2021
Received: from localhost ([127.0.0.1]:40947 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSEVF-0008Rn-Jm
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:18:17 -0400
Received: from sonic314-22.consmr.mail.ne1.yahoo.com ([66.163.189.148]:46262)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSEVE-0008Ra-7q
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:18:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632125890; bh=/m4PgNVO9O2XGX5S64oShDFX1yx0p4C/Bj+Qv49FrhI=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=t8MfbA7PW1kH4KZaxEUnnIP+Yit6lWofRJsQ0Z78TQihunrGuncN98JppRkTt8tMSENxjoH5qKWK0opXePG2GiM4vTHSIYnXt6H+DXSeSrSNIAK2F35TYItpuOsAJQD0nvGo3byt0et1KWndOi8pK09F+mzgGp7pRgaSdLhCcblIXMkk4MU4BSSA1/4pntISp1XJPmBoqz3CQbjF4E5XT16eeIo4gfZRDtid8ocxPM3aS3psvgrQ/FYK8bG5vPkFhR+b7BJy2IAQZhLr+Wu13pzDT3AKmnnPtJ9lHTiuQyOVfdGAyCYKPcdw339rHeUfk8dHddeMN2EtItBnaSycug==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632125890; bh=bz7FO8aUP5RBeGdkKjsf/O8Ago1Hj8rH/wiMswjnakZ=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=hkZYuRRdSH5e4jI2TLZNzIPBKxsTthCKT55LBf0el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vdnLgcLY
 SuUALCtZ1VKDvuJ7BeQLJwwotfihFtsOtHqf3NBJEHh.ZXwIivThLwfGdgpfCqQ3tI3LQKc3Vdv8
 EfSe40enatZn72pV3oNy359AMkKpWoyoYnTUI.Erz9o6Zx26lakD3TUcALP4Z9pc3f06bXhQwhoy
 019djuH_TVhBs3oVXjPPc5Q4ZaF3Y_ezKKIrnNIp2LG6gsfM1vwhJmYhoE0UL1zeQrKYhaYMMrpD
 HT16PUzn0jJnvico21ARSBiRgWUBUZC0tnvGRVxJ.degACvojebB.rUjPWg9a5HqxFkvnSozjXhN
 raiFth5DNvbD39ROBo.UjiNeFTj_Xr_eUR2WB3lFy0DFO5gIiqLPdLrdhJyFsVRvvHxm05J8JwME
 HCEG4J5C8T.ZDEd1Z.kWFpZz2OZMJ74sEaiAsiWgTeTEci6yBuTF_TpIgFPIXyOW6yNujZ7KWBn4
 36aAwwtVKmRL9z7Bk7rra3BsyvwiUG72.THuH_X6A.OBigT9GVWdvCuCGlnVN7KNT7mt1iivrlmB
 w3N5W5lS2NPmpNJ5m
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 08:18:10 +0000
Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID b8244493beecdcb509fc4eba9fcb71d0; 
 Mon, 20 Sep 2021 08:18:05 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <834kaf3ets.fsf@HIDDEN>
 <8335pz3dli.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 16:18:01 +0800
In-Reply-To: <8335pz3dli.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 10:34:01 +0300")
Message-ID: <87r1dj4q4m.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1883
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Actually, it looks like we already do everything we need to account
> for the box border, when it exists, while drawing the glyphs (in
> xterm.c/w32term.c).  The pixel_width of the glyphs is not used by the
> back-end code which actually draws to the glass.  So the only place
> which needs fixing is probably draw_phys_cursor_glyph and maybe also
> erase_phys_cursor.  Assuming we are indeed talking about problems with
> the glyph under the cursor.

My understanding is that when the cursor is drawn, the string in
RIF->draw_glyph_string contains _only_ the glyph underneath the cursor,
while the terminals only compensate for the box if the first glyph in
the string has a left box line; when drawing a cursor on the area with a
mouse face, that is only true if the cursor lands on the start of the
box.

In addition to that, draw_phys_cursor_glyph uses the value
w->output_cursor.x as the X offset passed to draw_glyphs, so I still
don't think the problem lies in draw_phys_cursor_glyph, but either in
where the cursor position is calculated (by tallying up the
pixel_widths), or where the mouse face is drawn without updating the
contents of the glyph row to reflect the potentially changed dimensions.
Personally, I still think the problem lies in the latter area and not
the former, but I'll leave that up to your judgement.

BTW, in x_set_cursor_gc, I notice that s->face isn't being set to the
mouse face even when the cursor lies inside the mouse face.  Perhaps
checking for cursor_in_mouse_face_p (s->w), and setting s->face to the
mouse face when that is the case would be prudent?  AFAIK, something
similar is already being done in x_draw_stretch_glyph_string (see this
chunk of code):

	  if (s->row->mouse_face_p
	      && cursor_in_mouse_face_p (s->w))
	    {
	      x_set_mouse_face_gc (s);
	      gc = s->gc;
	    }

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:02:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 04:02:57 2021
Received: from localhost ([127.0.0.1]:40928 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSEGP-00085f-8T
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:02:57 -0400
Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:40022)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSEGN-00085T-Qp
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:02:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632124970; bh=+PZhDwpwhVOUOwgldYeu4VsllwkIFmwgNnK5Volpgo8=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=eolxJo8D6gR+bjWn5c7H5LsWZeGRrLdgCiwfcAR9qFbCYaOXD3H1f7ylu++d4IwA1VgccxV83b0i7BtkjcG02dl5MPteJWlIoUJUxoRUAvQdotgCMb1d1q++mbLbiFFln9njgkkXB2KF1tQ60cEF1dOswd4dC6RnYajZtQIB/gScrmdFV7ZxKjlPUHc5v7kPjzt9gWZBZsQv2mmoqEYJt+8angQGqfsIZowsn/wbCtMdrK0gWHXnaQ9FOjiNlVesIoVJDbgGYNcfQRAKKVp0c9/elSxmLb5xuK88M4MCToVYGczacicL3PsglD8+wORlbxotGIKzz1ArJa5v5SG83w==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632124970; bh=MXvWAhWSHjzf1yabklASTjPs9cF8r5wq8h/nxGxQjBV=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=h7FDhTdH0l6jwo8N7rvEUA8liWmsvRcDdyl7DXRuVPSlUlGhS0KKN8RuF/Lbqj6BdzIuTqjF8kvYLxORZPk7fCqYsNxB3xaIed4qCXbqW4G3As9Nl6FbeCJ6SCsfWp+95Sx9sbIIXRPtLpXLOYfCvlaVkLQM5H9Yf2UV2Wu95FG1qDFUMiV8vuUWsa+91/NxMp2WCMMvQ0B+vSz22hfd0HO5hLOshCIIdY9zBSEDtwltDRvx0mpMjJDzpTNt21k0YppDbxsj4JDW8vGMbnSmawUdVktX7SpgqXlMuHow0SrGUQMH8WKD7MVNxTyPj1QMplB+TkiNQTXmUIPllShTMA==
X-YMail-OSG: siPv760VM1mySXJmBVR3dqI05ZYTTbF9NgKA1AL74VLFYRcoGYEqeAarTm8.gPg
 3z2N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gO4tZHBGJ76QiKyJ3018hU_CiRDHB0ojYX8Q3tq
 zsQm7YXyYR.khqd844oyUQYmUQc932uzGaTgegPskZFyqXz51E.B1eH8j7.tFahkoALJFiHXmOlT
 xaYL6tOnmxPnsg9JzcJi7_341d1ie_dtizghzdKpFVJZKN731BP1RwSbh4MstL2lrhukwSlPbgVt
 2cXzlGnTwsMiDvbDzEA--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 08:02:50 +0000
Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 427ba8c80f8f675ad788caf5954640e3; 
 Mon, 20 Sep 2021 08:02:43 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN> <83czp33j4d.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 16:02:40 +0800
In-Reply-To: <83czp33j4d.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 08:34:42 +0300")
Message-ID: <875yuv65en.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 368
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> In this scenario, the characters of the text with box-face move
> horizontally to account for the box border, as the mouse highlight is
> turned on and off, but the character under cursor does NOT move, and
> with large enough font this leaves small artifacts (because the
> character is not erased correctly).

Yes, precisely.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:02:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 04:02:22 2021
Received: from localhost ([127.0.0.1]:40924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSEFp-00084q-Sq
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:02:22 -0400
Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]:44385)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSEFk-00084Z-QZ
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 04:02:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632124931; bh=NTM5n5PSn/o7aNguPMjx0Jz4ACUsURC1QcJxt7HuxPU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=TGUdG/Bc373KYvul1SKCA+DfMwXrxSo9PQXpuwUwSdp6cbWCfVPlKZB7L1kpKWUJw8usLhb8FzUTMakF+bDVULQJHQA88VjDOBu3Y9AYanzsgHPIlvEBQP5S2IE/zQhFarPcdo3NrI8162d2+wybgpo32yw1iMlBJluq0ein2eLmOgPI+p01r1O2rm18E6WNbOr6CzD8VSTGK0qtNacw2FFxVpj9OY0WL1n31lEFsvLOd4+dks0xCttuxtA9DU0BxlGkmbUxf7jl8kfKlQ3DZxcGBrdVsDoDAlmUWdX5DdU2FCvMPeutDwpNJoENndTiekadxDwbn+ndyR5bejntTg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632124931; bh=dk4MatZiigsu3ETwsrml2n6ZA56alOVfW2vnvjG5K7x=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=Q9l4LHLRYzJRBJqsxnXjgnKQ7OWnZ5qyUN6XfNJIrBs5K0ED+df0SQ6wwWF3y0A8nS1ta+dVumC7M9BXqhijfBYbBia21her0Vr8fHmV+e4WbM20e2vLpMHXtOiVC1qlZdajtTz8DePpt4HgyB5iRwibeuuD1DGtoeMiXO3KNu5JLxTlm4bEO+dvQatKonl8MQtR0/EiSu8m8wcN9qEX8UzyaYl60ZGMql8S4ggf7TOs1UUvvSKUYuzXrVl/PIl/SlhVs4/G5t8BZWPEHMQHw+1Ez9pApvxMwm+aZtg1mWwWKjmACET0Fyn90LJOJ87L81H2QtB2oZi90WoZgtAbyg==
X-YMail-OSG: SHc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KOfpDacLe_
 KTl.s552x2JhF5ymyJx0X8gJdDI.pgHC.dAabxmLFu.ZlItBpzn6p18m2dfsLB1ppYZGLafYlsbi
 TRr_72QC6sgEDHO8_YhwdWXaVrKV_kNPP47hxm89Z0gi6Q480Woes3XqpVcqnDDyT_TXS5jrJNAy
 c5jTOOUsMX1Tv_VWdj17h7eKQDfaPVAyXx6sh09Pum62P9LoZCVgk0uZtiSLO_DGBYu.uVyn4y47
 hZhvSUaMcRf9aQiaq
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic301.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 08:02:11 +0000
Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 4c4f38a6f7b6dbee91dad7f41356910e; 
 Mon, 20 Sep 2021 08:02:06 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
 <83ee9j3ju3.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 16:02:02 +0800
In-Reply-To: <83ee9j3ju3.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Sep
 2021 08:19:16 +0300")
Message-ID: <87a6k765fp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 2207
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Thanks, this becomes clearer now.
>
> However, it is IMO wrong to "fix" the glyphs' pixel_width to account
> for the box face.  The glyphs didn't change, only their X-coordinate
> did.  By changing the width, we are in effect lying to any code that
> accesses the glyphs.  We should find another solution, perhaps similar
> to what the iterator does during the layout phase.

Interesting.  I don't quite know what the iterator does during the
layout phase, could you please point me to the relevant part of the
code?  Thanks.

> I still don't think I understand completely the problem you are
> talking about.  Is the problematic recipe as below?
>
>   . move the mouse pointer above text with box-face, so it is highlighted
>   . move the text cursor into the highlighted text
>
> Are there any other problems, or is the above the only problematic
> situation you saw and intended to fix?

That is the only situation I saw and intended to fix.

> Why do you need the two new flags?  If it's so you could avoid
> accounting for the box face too many times, isn't that a case of
> premature optimization?  A loop through a glyph-row's glyphs is
> straightforward and runs very fast.  The face of each glyph is stored
> in glyph->face_id, so you can easily see if its face includes the box
> attribute and get the box line thickness from that, and there are
> flags that tell you whether the box line is drawn on the left and on
> the right of the glyph.  What else is missing?

I suppose that is a case of premature optimization, thanks.

> Why did you need to recompute X in that case? why not fix the original
> computation instead?

Indeed, I have removed that change.

> I see only a couple of places, and they are all on the level of
> xterm.c/w32term.c, which is in an entirely different layer of the
> display code.  On the level of xdisp.c we only use mouse_face_face_id,
> AFAICT.

Hmm, it seems prudent to remove that then.  Thanks.

> Doesn't it logically belong to the job of display_and_set_cursor?

AFAIU, display_and_set_cursor only serves to set the position of the
cursor, and doesn't calculate or correct anything by itself.  Am I
missing something?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 07:34:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 03:34:22 2021
Received: from localhost ([127.0.0.1]:40900 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSDoj-0007NR-Ni
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 03:34:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53794)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSDog-0007N8-8I
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 03:34:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52164)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSDoa-0007fr-U1; Mon, 20 Sep 2021 03:34:12 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3668
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSDoa-0001Sl-En; Mon, 20 Sep 2021 03:34:12 -0400
Date: Mon, 20 Sep 2021 10:34:01 +0300
Message-Id: <8335pz3dli.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: luangruo@HIDDEN
In-Reply-To: <834kaf3ets.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 20
 Sep 2021 10:07:27 +0300)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
 <834kaf3ets.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 20 Sep 2021 10:07:27 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
> 
> I guess you are saying that in the problematic scenario the
> pixel_width of the glyphs remains the same, even though the box
> dimensions have changed or the box attribute disappeared?  If so, I
> think the problem is not where the cursor is drawn or its position is
> computed, the problem is where we redraw a portion of text due to
> change of mouse highlight, i.e. inside draw_row_with_mouse_face and
> friends.

Actually, it looks like we already do everything we need to account
for the box border, when it exists, while drawing the glyphs (in
xterm.c/w32term.c).  The pixel_width of the glyphs is not used by the
back-end code which actually draws to the glass.  So the only place
which needs fixing is probably draw_phys_cursor_glyph and maybe also
erase_phys_cursor.  Assuming we are indeed talking about problems with
the glyph under the cursor.

Do you agree?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 07:07:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 03:07:43 2021
Received: from localhost ([127.0.0.1]:40827 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSDOw-0002JK-Ot
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 03:07:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48652)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSDOu-0002J4-Rt
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 03:07:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51488)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSDOp-0001SL-MB; Mon, 20 Sep 2021 03:07:35 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1936
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSDOp-0006v7-9I; Mon, 20 Sep 2021 03:07:35 -0400
Date: Mon, 20 Sep 2021 10:07:27 +0300
Message-Id: <834kaf3ets.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: luangruo@HIDDEN
In-Reply-To: <83ee9j3ju3.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 20
 Sep 2021 08:19:16 +0300)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 20 Sep 2021 08:19:16 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
> 
> However, it is IMO wrong to "fix" the glyphs' pixel_width to account
> for the box face.

Walking through the code, I now see that we already update the
pixel_width of the border glyphs due to the box's vertical line.  So
set_cursor_from_row does its job correctly, and I still don't
understand why any change would be needed in it.

I guess you are saying that in the problematic scenario the
pixel_width of the glyphs remains the same, even though the box
dimensions have changed or the box attribute disappeared?  If so, I
think the problem is not where the cursor is drawn or its position is
computed, the problem is where we redraw a portion of text due to
change of mouse highlight, i.e. inside draw_row_with_mouse_face and
friends.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 06:33:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 02:33:22 2021
Received: from localhost ([127.0.0.1]:40798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSCri-0001Qi-3n
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 02:33:22 -0400
Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:39806)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mSCrf-0001QV-9j
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 02:33:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632119593; bh=by5zC5kyDMKvBCTTQ8MhaFpq18ecpp+YUsZ9+6KQ73g=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=aaYuTwighhQnafiRpEYUT0KpgzZsKENXejlkOqU4SrjpFmiybTFbSkQe5JsEgRLMiLtSm2NpGCH7C+8li1E+N1g6I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1.yahoo.com by
 sonic301.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 06:33:13 +0000
Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID e88d2523230a4683e92bc4caf23130cd; 
 Mon, 20 Sep 2021 06:33:05 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 14:33:01 +0800
In-Reply-To: <87fsu06oxi.fsf@HIDDEN> (Po Lu's message of "Mon, 20 Sep 2021
 09:00:57 +0800")
Message-ID: <87v92v69k2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 11875
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

BTW, here's an updated version of the patch with some issues I noticed
rectified.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-cursor-position.patch

From e39d92b045b6d90c460874b5b3981c8fce69fab3 Mon Sep 17 00:00:00 2001
From: Your Name <you@HIDDEN>
Date: Sun, 19 Sep 2021 21:41:36 +0800
Subject: [PATCH] Fix cursor showing up in incorrect position highlighting box

When computing the pixel width of glyphs, the produce_XXX_glyph series
of functions append the width of box lines to the glyph's pixel width;
This information is used for several tasks, such as calculating the
X-offset of the cursor.

Unfortunately, previously, this information would not be updated when
the the glyphs become displayed under mouse face, which caused issues
when the cursor was drawn over a section of text that was highlighted
while previously having a box.

* src/dispextern.h (have_glyph_with_box_p): New variable.
* src/dispextern.h (mouse_face_glyphs_processed_p): Likewise.
* src/xdisp.c (produce_image_glyph): Mark the row as having a box
if the vertical line width is more than 0.
* src/xdisp.c (produce_xwidget_glyph): Likewise.
* src/xdisp.c (IT_APPLY_FACE_BOX): Mark the iterator's row as having a
box if the vertical line width is more than 0.
* src/xdisp.c (draw_row_with_mouse_face): Modify glyphs in the row to
take into account differing vertical box line widths between the mouse
face and the original face.
* src/xdisp.c (clear_mouse_face): Recompute cursor position after
clearing mouse face.
---
 src/dispextern.h |  10 +++
 src/xdisp.c      | 199 +++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 187 insertions(+), 22 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 6aefe43e19..dfaf271639 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1065,6 +1065,16 @@ #define CHECK_MATRIX(MATRIX) ((void) 0)
      right-to-left paragraph.  */
   bool_bf reversed_p : 1;
 
+  /* True means there is at least one glyph in this row with a left
+     box line.  See the commentary inside `draw_row_with_mouse_face'
+     in xdisp.c for more details. */
+  bool_bf have_glyph_with_box_p : 1;
+
+  /* True means we have already processed the box glyphs on this
+     row for display under mouse face.  This can only be set if
+     have_glyph_with_box_p is true. */
+  bool_bf mouse_face_glyphs_processed_p : 1;
+
   /* Continuation lines width at the start of the row.  */
   int continuation_lines_width;
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 2e72f6b591..aa352b59f1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -29519,6 +29519,8 @@ produce_image_glyph (struct it *it)
 
       if (face->box_vertical_line_width > 0)
 	{
+	  if (it->glyph_row)
+	    it->glyph_row->have_glyph_with_box_p = 1;
 	  if (it->start_of_box_run_p && slice.x == 0)
 	    it->pixel_width += face->box_vertical_line_width;
 	  if (it->end_of_box_run_p && slice.x + slice.width == img->width)
@@ -29629,6 +29631,8 @@ produce_xwidget_glyph (struct it *it)
 
       if (face->box_vertical_line_width > 0)
 	{
+	  if (it->glyph_row)
+	    it->glyph_row->have_glyph_with_box_p = 1;
 	  if (it->start_of_box_run_p)
 	    it->pixel_width += face->box_vertical_line_width;
 	  it->pixel_width += face->box_vertical_line_width;
@@ -30393,27 +30397,29 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym)
 /* If face has a box, add the box thickness to the character
    height.  If character has a box line to the left and/or
    right, add the box line width to the character's width.  */
-#define IT_APPLY_FACE_BOX(it, face)				\
-  do {								\
-    if (face->box != FACE_NO_BOX)				\
-      {								\
-	int thick = face->box_horizontal_line_width;		\
-	if (thick > 0)						\
-	  {							\
-	    it->ascent += thick;				\
-	    it->descent += thick;				\
-	  }							\
-								\
-	thick = face->box_vertical_line_width;			\
-	if (thick > 0)						\
-	  {							\
-	    if (it->start_of_box_run_p)				\
-	      it->pixel_width += thick;				\
-	    if (it->end_of_box_run_p)				\
-	      it->pixel_width += thick;				\
-	  }							\
-      }								\
-    } while (false)
+#define IT_APPLY_FACE_BOX(it, face)					\
+  do {									\
+    if (face->box != FACE_NO_BOX)					\
+      {									\
+	int thick = face->box_horizontal_line_width;			\
+	if (thick > 0)							\
+	  {								\
+	    it->ascent += thick;					\
+	    it->descent += thick;					\
+	  }								\
+									\
+	thick = face->box_vertical_line_width;				\
+	if (thick > 0)							\
+	  {								\
+	    if (it->glyph_row)						\
+	      it->glyph_row->have_glyph_with_box_p = 1;	\
+	    if (it->start_of_box_run_p)					\
+	      it->pixel_width += thick;					\
+	    if (it->end_of_box_run_p)					\
+	      it->pixel_width += thick;					\
+	  }								\
+      }									\
+  } while (false)
 
 /* RIF:
    Produce glyphs/get display metrics for the display element IT is
@@ -32044,7 +32050,97 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
 			  enum draw_glyphs_face draw)
 {
 #ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (XFRAME (w->frame)))
+  /* Basically, when have_glyph_with_box_p is true,
+     we know we are dealing with a row that has at least one
+     glyph with a box line.
+
+     As such, for each glyph within the highlighted region that has
+     box lines and is the start of a box, we subtract the width of the
+     lines from its pixel_width.  */
+  int remove_p = draw != DRAW_MOUSE_FACE;
+
+  if (row->have_glyph_with_box_p &&
+      FRAME_WINDOW_P (XFRAME (w->frame)) &&
+      remove_p == row->mouse_face_glyphs_processed_p)
+    {
+      struct frame *f = WINDOW_XFRAME (w);
+      struct face *mouse_face =
+	FACE_FROM_ID_OR_NULL (f, MOUSE_HL_INFO (f)->mouse_face_face_id);
+
+      if (mouse_face == NULL)
+	mouse_face = FACE_FROM_ID (f, MOUSE_FACE_ID);
+
+      int end_of_modified_glyphs = start_x;
+      struct glyph *g = NULL;
+
+      for (int i = start_hpos; i <= end_hpos; ++i)
+	{
+	  g = &row->glyphs[TEXT_AREA][i];
+	  struct face *mouse = mouse_face;
+	  struct face *regular_face = FACE_FROM_ID (f, g->face_id);
+
+	  if (remove_p)
+	    {
+	      if (g->type == CHAR_GLYPH)
+		mouse = FACE_FROM_ID (f, FACE_FOR_CHAR
+				      (f, mouse_face, g->u.ch, -1, Qnil));
+
+	      struct face *temp = regular_face;
+	      regular_face = mouse;
+	      mouse = temp;
+	    }
+
+	  bool do_left_box_p = g->left_box_line_p;
+	  bool do_right_box_p = g->right_box_line_p;
+
+	  if (row->reversed_p && g->type == IMAGE_GLYPH)
+	    {
+	      struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						 g->u.img_id);
+	      do_left_box_p = g->right_box_line_p &&
+		g->slice.img.x + g->slice.img.width == img->width;
+	      do_right_box_p = g->left_box_line_p &&
+		g->slice.img.x == 0;
+	    }
+	  else if (g->type == IMAGE_GLYPH)
+	    {
+	      struct image *img = IMAGE_FROM_ID (WINDOW_XFRAME (w),
+						 g->u.img_id);
+	      do_left_box_p = g->left_box_line_p &&
+		g->slice.img.x + g->slice.img.width == img->width;
+	      do_right_box_p = g->right_box_line_p &&
+		g->slice.img.x == 0;
+	    }
+
+	  /* If the glyph has a left box line, subtract from it the
+	     original width of the line. */
+	  if (do_left_box_p)
+	    g->pixel_width -= max (0, regular_face->box_vertical_line_width);
+	  /* Likewise with the right box line, as there may be a box
+	     there as well. */
+	  if (do_right_box_p)
+	    g->pixel_width -= max (0, regular_face->box_vertical_line_width);
+	  /* Now we add the line widths from the new face. */
+	  if (g->left_box_line_p)
+	    g->pixel_width += max (0, mouse->box_vertical_line_width);
+	  if (g->right_box_line_p)
+	    g->pixel_width += max (0, mouse->box_vertical_line_width);
+
+	  end_of_modified_glyphs += g->pixel_width;
+	}
+      row->mouse_face_glyphs_processed_p = !remove_p;
+
+      /* Redraw the entire row so changes are taken into effect. */
+      draw_glyphs (w, row->x, row, TEXT_AREA,
+		   0, row->used[TEXT_AREA],
+		   DRAW_NORMAL_TEXT, 0);
+
+      /* Now draw the mouse face area. */
+      if (draw != DRAW_NORMAL_TEXT)
+	draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
+      return;
+    }
+  else if (FRAME_WINDOW_P (XFRAME (w->frame)))
     {
       draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
       return;
@@ -32067,6 +32163,8 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
   struct window *w = XWINDOW (hlinfo->mouse_face_window);
   struct frame *f = XFRAME (WINDOW_FRAME (w));
 
+  int unblock_flipping = 0;
+
   /* Don't bother doing anything if we are on a wrong frame.  */
   if (f != hlinfo->mouse_face_mouse_frame)
     return;
@@ -32148,6 +32246,19 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 
 	  if (end_hpos > start_hpos)
 	    {
+#ifdef HAVE_WINDOW_SYSTEM
+	      if (FRAME_WINDOW_P (f) &&
+		  w->phys_cursor_on_p && MATRIX_ROW (w->current_matrix,
+						     w->phys_cursor.vpos) == row)
+		{
+		  /* Helps reduce flicker. */
+		  unblock_flipping = true;
+		  block_buffer_flips ();
+		  /* The cursor's position will be changed later, and if we don't clear it now,
+		     artifacting can result. */
+		  gui_clear_cursor (w);
+		}
+#endif
 	      draw_row_with_mouse_face (w, start_x, row,
 					start_hpos, end_hpos, draw);
 
@@ -32173,6 +32284,36 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	    hpos = row->used[TEXT_AREA] - 1;
 
 	  block_input ();
+	  /* If there's a row with a box somewhere, by all likelyhood
+	     the dimensions of the row has been changed.  If that is
+	     the case, and we also find a row where the phys cursor
+	     is, recalculate the dimensions of the phys cursor. */
+	  for (row = first; row <= last && row->enabled_p; ++row)
+	    if (row->have_glyph_with_box_p &&
+		MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos) == row)
+	      {
+		int cx = 0, hpos = 0;
+		struct glyph *start = row->glyphs[TEXT_AREA];
+		struct glyph *last = start + row->used[TEXT_AREA] - (intptr_t) 1;
+
+		for (struct glyph *glyph = start; glyph <= last; glyph++)
+		  {
+
+		    if (hpos == w->phys_cursor.hpos)
+		      {
+			w->cursor.x = cx;
+			w->phys_cursor.x = cx;
+			goto set_cursor;
+		      }
+
+		    cx += glyph->pixel_width;
+		    ++hpos;
+		  }
+		/* Why was the phys cursor glyph not found, even
+		   though the phys cursor is on this row? */
+		emacs_abort ();
+	      }
+	set_cursor:
 	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
 				  w->phys_cursor.x, w->phys_cursor.y);
 	  unblock_input ();
@@ -32197,6 +32338,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->nontext_cursor);
     }
 #endif	/* HAVE_WINDOW_SYSTEM */
+
+  if (unblock_flipping)
+    unblock_buffer_flips ();
 }
 
 /* EXPORT:
@@ -32209,12 +32353,23 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
 {
   bool cleared
     = !hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window);
+#ifdef HAVE_WINDOW_SYSTEM
+  bool cursor_was_in_mouse_face_p =
+    cleared && cursor_in_mouse_face_p (XWINDOW (hlinfo->mouse_face_window));
+  struct window *w = cleared ? XWINDOW (hlinfo->mouse_face_window) : NULL;
+#endif /* HAVE_WINDOW_SYSTEM */
   if (cleared)
     show_mouse_face (hlinfo, DRAW_NORMAL_TEXT);
   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;
   hlinfo->mouse_face_overlay = Qnil;
+#ifdef HAVE_WINDOW_SYSTEM
+  if (cursor_was_in_mouse_face_p)
+    set_cursor_from_row (w, MATRIX_ROW (w->current_matrix,
+					w->phys_cursor.vpos),
+			 w->current_matrix, 0, 0, 0, 0);
+#endif /* HAVE_WINDOW_SYSTEM */
   return cleared;
 }
 
-- 
2.33.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 05:35:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 01:35:00 2021
Received: from localhost ([127.0.0.1]:40626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSBxE-0007zU-DQ
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:35:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33532)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSBxC-0007zG-Ca
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:34:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49328)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSBx7-00062l-4m; Mon, 20 Sep 2021 01:34:53 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3930
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSBx6-0000z5-OM; Mon, 20 Sep 2021 01:34:53 -0400
Date: Mon, 20 Sep 2021 08:34:42 +0300
Message-Id: <83czp33j4d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: luangruo@HIDDEN
In-Reply-To: <83ee9j3ju3.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 20
 Sep 2021 08:19:16 +0300)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN> <83ee9j3ju3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 20 Sep 2021 08:19:16 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
> 
> I still don't think I understand completely the problem you are
> talking about.  Is the problematic recipe as below?
> 
>   . move the mouse pointer above text with box-face, so it is highlighted
>   . move the text cursor into the highlighted text

Actually, the only recipe in which I can see problems is this:

  . move the text cursor into text that has a face with the box attribute
  . move the mouse pointer into and out of that text

In this scenario, the characters of the text with box-face move
horizontally to account for the box border, as the mouse highlight is
turned on and off, but the character under cursor does NOT move, and
with large enough font this leaves small artifacts (because the
character is not erased correctly).

Is that the problem you are trying to solve, i.e. the problematic
display is limited to the character under cursor when text is
mouse-highlighted and unhighlighted?

Or maybe one needs specially-defined faces to see the problem?  If so,
please show the definitions of those faces, preferably as part of a
complete recipe starting from "emacs -Q".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 05:19:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 01:19:36 2021
Received: from localhost ([127.0.0.1]:40567 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSBiK-0007T0-3u
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:19:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60282)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mSBiG-0007Sj-Fd
 for 50660 <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:19:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49030)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mSBiB-0001fx-2r; Mon, 20 Sep 2021 01:19:27 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2990
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mSBiA-000665-ME; Mon, 20 Sep 2021 01:19:27 -0400
Date: Mon, 20 Sep 2021 08:19:16 +0300
Message-Id: <83ee9j3ju3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87fsu06oxi.fsf@HIDDEN> (message from Po Lu on Mon, 20 Sep
 2021 09:00:57 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN> <87fsu06oxi.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Mon, 20 Sep 2021 09:00:57 +0800
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I admit that I'm confused.  I don't think I understand what did you
> > find was the problem, and how it came into existence.  Can you explain
> > it in detail, step by step, with references to the current code on
> > master?
> 
> In set_cursor_from_row, the cursor's X position is calculated by summing
> up the pixel_width of each glyph, from the start of the row (if not
> reversed), or from the end (if reversed).
> 
> Inside the produce_XXX_glyph series of functions, the widths of each box
> line is added to the iterator's pixel_width (take this snippet from
> produce_image_glyph)
> 
>   if (face->box != FACE_NO_BOX)
>     {
>       if (face->box_horizontal_line_width > 0)
> 	{
> 	  if (slice.y == 0)
> 	    it->ascent += face->box_horizontal_line_width;
> 	  if (slice.y + slice.height == img->height)
> 	    it->descent += face->box_horizontal_line_width;
> 	}
> 
>       if (face->box_vertical_line_width > 0)
> 	{
> 	  if (it->start_of_box_run_p && slice.x == 0)
> 	    it->pixel_width += face->box_vertical_line_width;
> 	  if (it->end_of_box_run_p && slice.x + slice.width == img->width)
> 	    it->pixel_width += face->box_vertical_line_width;
> 	}
>     }
> 
> But when part of the row gets highlighted, it becomes drawn in the mouse
> face, which might have greatly different box widths (or none at all)
> compared to the face in which it was originally drawn.  This causes
> issues when moving the point (and thus the cursor) over the highlighted
> area, because the glyph_width of the glyphs reflect the state before the
> area was highlighted, and not after, and the cursor will be offset by
> the original width of the box lines, which may be incorrect under mouse
> face.
> 
> For example, the face `custom-button' has a vertical line 2 pixels wide,
> but `highlight' has no vertical line.  If an area under the face
> `custom-button' is becomes highlighted and under the face `highlight',
> and the cursor is moved into the area, the cursor will be 2 pixels too
> far towards the end of the row (assuming it is not reversed), and
> potentially more, if there are more glyphs between the cursor and the
> start/end of the highlighted area with left and/or right box lines!
> 
> > You said the problem happens when one moves the mouse pointer over
> > text whose face has a box.  You said explicitly that clicking the
> > mouse or dragging it over the text was not required.  Did I understand
> > you correctly?  If I understood you correctly, then I don't think I
> > see how drawing the cursor could be involved, because moving the mouse
> > pointer without clicking doesn't move point, and thus the cursor
> > doesn't need to be moved.
> 
> Yes, but if you move the point into the highlighted area with other
> editing commands, such as the arrow keys, the problem will manifest.
> 
> >> Unfortunately, previously, this information would not be updated when
> >> the the glyphs become displayed under mouse face
> 
> > What information was not updated, exactly?
> 
> The pixel_width of each glyph in the row that was highlighted and has
> left_box_line_p, or right_box_line_p.

Thanks, this becomes clearer now.

However, it is IMO wrong to "fix" the glyphs' pixel_width to account
for the box face.  The glyphs didn't change, only their X-coordinate
did.  By changing the width, we are in effect lying to any code that
accesses the glyphs.  We should find another solution, perhaps similar
to what the iterator does during the layout phase.

> > When the text becomes highlighted, the face in effect is mouse-face,
> > which usually doesn't have the box attribute, and so the text moves
> > horizontally, which is expected.
> 
> Yes, that isn't the problem I'm talking about.

I still don't think I understand completely the problem you are
talking about.  Is the problematic recipe as below?

  . move the mouse pointer above text with box-face, so it is highlighted
  . move the text cursor into the highlighted text

Are there any other problems, or is the above the only problematic
situation you saw and intended to fix?

> > In any case, I'm surprised that fixing such a minor issue needed so
> > much code, including changes to data structures.  Are you sure you
> > used all the information we store in glyph_row and in each glyph?
> > (Once I understand the problem better, I will be able to answer this
> > question myself, but I'm not there yet.)
> 
> I hope I have, but please tell me if I haven't.

Why do you need the two new flags?  If it's so you could avoid
accounting for the box face too many times, isn't that a case of
premature optimization?  A loop through a glyph-row's glyphs is
straightforward and runs very fast.  The face of each glyph is stored
in glyph->face_id, so you can easily see if its face includes the box
attribute and get the box line thickness from that, and there are
flags that tell you whether the box line is drawn on the left and on
the right of the glyph.  What else is missing?

> >> @@ -17131,6 +17131,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
> >>  	  x = -1;
> >>  	}
> >>      }
> >> +  if (row->have_glyph_with_box_p)
> >> +    x = -1;
> >
> > Here, I don't understand why the cursor position is affected, and I
> > don't understand why you subtract the fixed value of 1 pixel.  The box
> > thickness doesn't have to be 1, and it could be positive or negative.
> 
> If I understand correctly, setting x to -1 should force it to be
> re-computed later, when the code enters compute_x.  Is that not correct?

Why did you need to recompute X in that case? why not fix the original
computation instead?

> >> +      struct face *mouse_face =
> >> +	FACE_FROM_ID_OR_NULL (f, MOUSE_HL_INFO (f)->mouse_face_face_id);
> >> +
> >> +      if (mouse_face == NULL)
> >> +	mouse_face = FACE_FROM_ID (f, MOUSE_FACE_ID);
> 
> > When is this last NULL check actually needed?
> 
> I'm not exactly sure, but a lot of code seems to do that.

I see only a couple of places, and they are all on the level of
xterm.c/w32term.c, which is in an entirely different layer of the
display code.  On the level of xdisp.c we only use mouse_face_face_id,
AFAICT.

> >> +	  /* If there's a row with a box somewhere, by all likelyhood
> >> +	     the dimensions of the row has been changed.  If that is
> >> +	     the case, and we also find a row where the phys cursor
> >> +	     is, recalculate the dimensions of the phys cursor. */
> 
> > I also don't understand this part.  When is it needed and why?  And
> > why not handle it in display_and_set_cursor (if it isn't handled
> > already)?
> 
> I think display_and_set_cursor doesn't do any calculating.  Here, what's
> happening is that the X-offset of the phys cursor is being re-computed,
> to compensate for any changes that might have happened to the
> pixel_width of the glyphs.

Doesn't it logically belong to the job of display_and_set_cursor?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 01:01:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 21:01:16 2021
Received: from localhost ([127.0.0.1]:40341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mS7gK-00010N-8E
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 21:01:16 -0400
Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]:39515)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mS7gG-000108-TO
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 21:01:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632099667; bh=Bv0XuQigB+oeFjna6STuN6rPJxwvdfCMs8f+Fs1/Hnk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=LEBKeEUknwvKUd58obRQwUvK6XipKYz3vBzjOOxdYu/n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eVXe5CT
 9BiZ6MSb9125n_mVjfw--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic317.consmr.mail.ne1.yahoo.com with HTTP; Mon, 20 Sep 2021 01:01:07 +0000
Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 932b7626f2a51ca1d09edf56ab5636c4; 
 Mon, 20 Sep 2021 01:01:01 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
 <838rzs4i09.fsf@HIDDEN>
Date: Mon, 20 Sep 2021 09:00:57 +0800
In-Reply-To: <838rzs4i09.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 19 Sep
 2021 20:01:10 +0300")
Message-ID: <87fsu06oxi.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 6052
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> I admit that I'm confused.  I don't think I understand what did you
> find was the problem, and how it came into existence.  Can you explain
> it in detail, step by step, with references to the current code on
> master?

In set_cursor_from_row, the cursor's X position is calculated by summing
up the pixel_width of each glyph, from the start of the row (if not
reversed), or from the end (if reversed).

Inside the produce_XXX_glyph series of functions, the widths of each box
line is added to the iterator's pixel_width (take this snippet from
produce_image_glyph)

  if (face->box != FACE_NO_BOX)
    {
      if (face->box_horizontal_line_width > 0)
	{
	  if (slice.y == 0)
	    it->ascent += face->box_horizontal_line_width;
	  if (slice.y + slice.height == img->height)
	    it->descent += face->box_horizontal_line_width;
	}

      if (face->box_vertical_line_width > 0)
	{
	  if (it->start_of_box_run_p && slice.x == 0)
	    it->pixel_width += face->box_vertical_line_width;
	  if (it->end_of_box_run_p && slice.x + slice.width == img->width)
	    it->pixel_width += face->box_vertical_line_width;
	}
    }

But when part of the row gets highlighted, it becomes drawn in the mouse
face, which might have greatly different box widths (or none at all)
compared to the face in which it was originally drawn.  This causes
issues when moving the point (and thus the cursor) over the highlighted
area, because the glyph_width of the glyphs reflect the state before the
area was highlighted, and not after, and the cursor will be offset by
the original width of the box lines, which may be incorrect under mouse
face.

For example, the face `custom-button' has a vertical line 2 pixels wide,
but `highlight' has no vertical line.  If an area under the face
`custom-button' is becomes highlighted and under the face `highlight',
and the cursor is moved into the area, the cursor will be 2 pixels too
far towards the end of the row (assuming it is not reversed), and
potentially more, if there are more glyphs between the cursor and the
start/end of the highlighted area with left and/or right box lines!

> You said the problem happens when one moves the mouse pointer over
> text whose face has a box.  You said explicitly that clicking the
> mouse or dragging it over the text was not required.  Did I understand
> you correctly?  If I understood you correctly, then I don't think I
> see how drawing the cursor could be involved, because moving the mouse
> pointer without clicking doesn't move point, and thus the cursor
> doesn't need to be moved.

Yes, but if you move the point into the highlighted area with other
editing commands, such as the arrow keys, the problem will manifest.

>> Unfortunately, previously, this information would not be updated when
>> the the glyphs become displayed under mouse face

> What information was not updated, exactly?

The pixel_width of each glyph in the row that was highlighted and has
left_box_line_p, or right_box_line_p.

> When the text becomes highlighted, the face in effect is mouse-face,
> which usually doesn't have the box attribute, and so the text moves
> horizontally, which is expected.

Yes, that isn't the problem I'm talking about.

> And the only glyphs whose pixel_width is affected in this situation
> are the glyphs where the box face begins or ends.  What was missing in
> handling this situation?

Basically, the pixel_width of these glyphs at the beginning or the end
of the box face have to be updated.  Otherwise, if the cursor moves over
the box it is highlighted with the mouse-face, it might appear at the
wrong position, as explained above.

> In any case, I'm surprised that fixing such a minor issue needed so
> much code, including changes to data structures.  Are you sure you
> used all the information we store in glyph_row and in each glyph?
> (Once I understand the problem better, I will be able to answer this
> question myself, but I'm not there yet.)

I hope I have, but please tell me if I haven't.

> Some minor comments and questions below.
>
>> @@ -17131,6 +17131,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
>>  	  x = -1;
>>  	}
>>      }
>> +  if (row->have_glyph_with_box_p)
>> +    x = -1;
>
> Here, I don't understand why the cursor position is affected, and I
> don't understand why you subtract the fixed value of 1 pixel.  The box
> thickness doesn't have to be 1, and it could be positive or negative.

If I understand correctly, setting x to -1 should force it to be
re-computed later, when the code enters compute_x.  Is that not correct?

> I don't understand why we need to do this adjustment of glyphs' width.

Hopefully my explanation above should have made this clear.

>> +      struct face *mouse_face =
>> +	FACE_FROM_ID_OR_NULL (f, MOUSE_HL_INFO (f)->mouse_face_face_id);
>> +
>> +      if (mouse_face == NULL)
>> +	mouse_face = FACE_FROM_ID (f, MOUSE_FACE_ID);

> When is this last NULL check actually needed?

I'm not exactly sure, but a lot of code seems to do that.

>> +	  /* If there's a row with a box somewhere, by all likelyhood
>> +	     the dimensions of the row has been changed.  If that is
>> +	     the case, and we also find a row where the phys cursor
>> +	     is, recalculate the dimensions of the phys cursor. */

> I also don't understand this part.  When is it needed and why?  And
> why not handle it in display_and_set_cursor (if it isn't handled
> already)?

I think display_and_set_cursor doesn't do any calculating.  Here, what's
happening is that the X-offset of the phys cursor is being re-computed,
to compensate for any changes that might have happened to the
pixel_width of the glyphs.

>> +		struct glyph *start = row->glyphs[TEXT_AREA];
>> +		struct glyph *last = start + row->used[TEXT_AREA] - (intptr_t) 1;
>> +
>> +		while (last > start && last->charpos < 0)
>> +		  --last;
>
> Here you assume that only glyphs at end of the row could have negative
> charpos, but that's not true.  Glyphs at the start could have that as
> well.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 17:01:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 13:01:31 2021
Received: from localhost ([127.0.0.1]:39775 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mS0C3-0007jq-2H
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 13:01:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mS0C0-0007jb-1g
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 13:01:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57902)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mS0Bu-0006nc-7H; Sun, 19 Sep 2021 13:01:22 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1674
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mS0Bt-00013P-Qj; Sun, 19 Sep 2021 13:01:22 -0400
Date: Sun, 19 Sep 2021 20:01:10 +0300
Message-Id: <838rzs4i09.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87h7egy8jo.fsf@HIDDEN> (message from Po Lu on Sun, 19 Sep
 2021 21:55:07 +0800)
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: larsi@HIDDEN,  50660 <at> debbugs.gnu.org
> Date: Sun, 19 Sep 2021 21:55:07 +0800
> 
> Ok, I spent some time doing that.  I have attached a patch which
> resolves this problem on my side, but could you please look at it and
> see if I'm doing anything wrong?  Thanks.
> 
> I have tried to provide a detailed explanation of the changes in the
> patch message and the code itself.

Thanks.

I admit that I'm confused.  I don't think I understand what did you
find was the problem, and how it came into existence.  Can you explain
it in detail, step by step, with references to the current code on
master?

You said the problem happens when one moves the mouse pointer over
text whose face has a box.  You said explicitly that clicking the
mouse or dragging it over the text was not required.  Did I understand
you correctly?  If I understood you correctly, then I don't think I
see how drawing the cursor could be involved, because moving the mouse
pointer without clicking doesn't move point, and thus the cursor
doesn't need to be moved.

Next, I don't think I follow this part:

> Unfortunately, previously, this information would not be updated when
> the the glyphs become displayed under mouse face

What information was not updated, exactly?  When the text becomes
highlighted, the face in effect is mouse-face, which usually doesn't
have the box attribute, and so the text moves horizontally, which is
expected.  And the only glyphs whose pixel_width is affected in this
situation are the glyphs where the box face begins or ends.  What was
missing in handling this situation?

When you explain these things, please refer to the code which you
describe, so that I could follow your line of thought better.

In any case, I'm surprised that fixing such a minor issue needed so
much code, including changes to data structures.  Are you sure you
used all the information we store in glyph_row and in each glyph?
(Once I understand the problem better, I will be able to answer this
question myself, but I'm not there yet.)

Some minor comments and questions below.

> @@ -17131,6 +17131,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
>  	  x = -1;
>  	}
>      }
> +  if (row->have_glyph_with_box_p)
> +    x = -1;

Here, I don't understand why the cursor position is affected, and I
don't understand why you subtract the fixed value of 1 pixel.  The box
thickness doesn't have to be 1, and it could be positive or negative.

> +  /* Basically, when have_glyph_with_box_p is true,
> +     we know we are dealing with a row that has at least one
> +     glyph with a box line.
> +
> +     As such, for each glyph within the highlighted region that has
> +     box lines and is the start of a box, we subtract the width of the
> +     lines from its pixel_width.  */

I don't understand why we need to do this adjustment of glyphs' width.

> +      struct face *mouse_face =
> +	FACE_FROM_ID_OR_NULL (f, MOUSE_HL_INFO (f)->mouse_face_face_id);
> +
> +      if (mouse_face == NULL)
> +	mouse_face = FACE_FROM_ID (f, MOUSE_FACE_ID);

When is this last NULL check actually needed?

> +	  /* If there's a row with a box somewhere, by all likelyhood
> +	     the dimensions of the row has been changed.  If that is
> +	     the case, and we also find a row where the phys cursor
> +	     is, recalculate the dimensions of the phys cursor. */

I also don't understand this part.  When is it needed and why?  And
why not handle it in display_and_set_cursor (if it isn't handled
already)?

> +		struct glyph *start = row->glyphs[TEXT_AREA];
> +		struct glyph *last = start + row->used[TEXT_AREA] - (intptr_t) 1;
> +
> +		while (last > start && last->charpos < 0)
> +		  --last;

Here you assume that only glyphs at end of the row could have negative
charpos, but that's not true.  Glyphs at the start could have that as
well.

Thanks again for working on this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 15:13:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 11:13:58 2021
Received: from localhost ([127.0.0.1]:39530 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRyVy-0004a8-32
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 11:13:58 -0400
Received: from quimby.gnus.org ([95.216.78.240]:43148)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mRyVv-0004Zs-D9
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 11:13:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=hOKVg9+M5MqKutdrysSv7SP4RiUTOobe0wpfrf/xZl4=; b=vMVebIGNa+csF43uU+M+b5fu48
 t7c4xmBA8GjbnbshgNuBAgqPU06XnJEdJnZeuiN8RTsN9k2UAMA+GkBzEC5xVwofz0KnHXrG3O0Zf
 P2XRV1IDffhZ9ZhdqDv5c0vyPZ3OcOF1HKSkaEFEq5c+BKkQYKzEBOO6jxZtKo08xLjM=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mRyVm-0000eg-Hy; Sun, 19 Sep 2021 17:13:49 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN> <87h7egy8jo.fsf@HIDDEN>
Date: Sun, 19 Sep 2021 17:13:46 +0200
In-Reply-To: <87h7egy8jo.fsf@HIDDEN> (Po Lu's message of "Sun, 19 Sep 2021
 21:55:07 +0800")
Message-ID: <877dfcoaxh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > Ok, I spent some time
 doing that. I have attached a patch which > resolves this problem on my side, 
 but could you please look at it and > see if I'm doing anything wrong? Thanks.
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: Eli Zaretskii <eliz@HIDDEN>, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> Ok, I spent some time doing that.  I have attached a patch which
> resolves this problem on my side, but could you please look at it and
> see if I'm doing anything wrong?  Thanks.

I tried the patch, and it didn't fix the glitches I was seeing (when
mouse-selecting the region), so those seem to be unrelated things.  (I
haven't read the patch.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 15:10:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 11:10:52 2021
Received: from localhost ([127.0.0.1]:39523 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRySy-0004VE-LN
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 11:10:52 -0400
Received: from quimby.gnus.org ([95.216.78.240]:43016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mRySu-0004Ut-5X
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 11:10:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VAhclqs0GaV6PsAhnNjwYiszDW0wG7b6lPkt5HZRfWU=; b=miU/URChvSCL50j6NZuu+9vdzQ
 CBU2BybRhxqtPvNI2o3N+PGAqaewfsf6ayd91STkIVBxdSQ6tegzStmLaNVJhgWwtGc7tZ0FxCY8+
 Ru8MjFh7bAqFRt89eYC6ED5g8WThJ10xN4Dsdc9ma539o4yO5KTCZ1hPAqUxFgt9XYeM=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mRySk-0000XC-KV; Sun, 19 Sep 2021 17:10:42 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <871r5lz8w4.fsf@HIDDEN>
Date: Sun, 19 Sep 2021 17:10:38 +0200
In-Reply-To: <871r5lz8w4.fsf@HIDDEN> (Po Lu's message of "Sun, 19 Sep 2021
 08:50:03 +0800")
Message-ID: <87bl4oob2p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > But wait a second...
 What do you mean by marking a region with the > mouse? The recipe I provided
 is to hover your pointer over the sample > text, and then to move your (Emacs)
 cursor over the sampl [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> But wait a second... What do you mean by marking a region with the
> mouse?  The recipe I provided is to hover your pointer over the sample
> text, and then to move your (Emacs) cursor over the sample text.
>
> Could you please try that, and see what happens?  Thanks.

I tried that, and I didn't see any artefacts when doing so.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 13:55:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 09:55:28 2021
Received: from localhost ([127.0.0.1]:38620 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRxHz-0000Dx-PO
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 09:55:28 -0400
Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:42446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mRxHu-0008TR-Fi
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 09:55:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632059717; bh=hdvgya0FmZkXeywQm8r6zidE8lhngWQQ2d4QP5sm/vU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=D0MEeDOVfzhUxgqq454z0M933TtaR7gzm3iC3zYM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3AhiOK3rRwc-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Sep 2021 13:55:17 +0000
Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 6053094558b09e0f311428b326ca2a24; 
 Sun, 19 Sep 2021 13:55:11 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
 <831r5l5d6d.fsf@HIDDEN>
Date: Sun, 19 Sep 2021 21:55:07 +0800
In-Reply-To: <831r5l5d6d.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 19 Sep
 2021 08:47:54 +0300")
Message-ID: <87h7egy8jo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 11872
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

> Feel free to dig in the display code involved in this, I don't intend
> doing that any time soon.

Ok, I spent some time doing that.  I have attached a patch which
resolves this problem on my side, but could you please look at it and
see if I'm doing anything wrong?  Thanks.

I have tried to provide a detailed explanation of the changes in the
patch message and the code itself.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-cursor-position.patch
Content-Description: Fix

From 04ad1a5eb79a8a427ba01c1a107692cf66fcec95 Mon Sep 17 00:00:00 2001
Date: Sun, 19 Sep 2021 21:41:36 +0800
Subject: [PATCH] Fix cursor showing up in incorrect position highlighting box

When computing the pixel width of glyphs, the produce_XXX_glyph series
of functions append the width of box lines to the glyph's pixel width;
This information is used for several tasks, such as calculating the
X-offset of the cursor.

Unfortunately, previously, this information would not be updated when
the the glyphs become displayed under mouse face, which caused issues
when the cursor was drawn over a section of text that was highlighted
while previously having a box.

* src/dispextern.h (have_glyph_with_box_p): New variable.
* src/dispextern.h (mouse_face_glyphs_processed_p): Likewise.
* src/xdisp.c (set_cursor_from_box): Force X-offset computation if the
row has at least 1 glyph with some kind of left or right box.
* src/xdisp.c (produce_image_glyph): Mark the row as having a box
if the vertical line width is more than 0.
* src/xdisp.c (produce_xwidget_glyph): Likewise.
* src/xdisp.c (IT_APPLY_FACE_BOX): Mark the iterator's row as having a
box if the vertical line width is more than 0.
* src/xdisp.c (draw_row_with_mouse_face): Modify glyphs in the row to
take into account differing vertical box line widths between the mouse
face and the original face.
* src/xdisp.c (clear_mouse_face): Recompute cursor position after
clearing mouse face.
---
 src/dispextern.h |  10 +++
 src/xdisp.c      | 181 +++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 169 insertions(+), 22 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 6aefe43e19..dfaf271639 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1065,6 +1065,16 @@ #define CHECK_MATRIX(MATRIX) ((void) 0)
      right-to-left paragraph.  */
   bool_bf reversed_p : 1;
 
+  /* True means there is at least one glyph in this row with a left
+     box line.  See the commentary inside `draw_row_with_mouse_face'
+     in xdisp.c for more details. */
+  bool_bf have_glyph_with_box_p : 1;
+
+  /* True means we have already processed the box glyphs on this
+     row for display under mouse face.  This can only be set if
+     have_glyph_with_box_p is true. */
+  bool_bf mouse_face_glyphs_processed_p : 1;
+
   /* Continuation lines width at the start of the row.  */
   int continuation_lines_width;
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 2e72f6b591..a90c52644f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17131,6 +17131,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
 	  x = -1;
 	}
     }
+  if (row->have_glyph_with_box_p)
+    x = -1;
 
  compute_x:
   if (cursor != NULL)
@@ -29519,6 +29521,8 @@ produce_image_glyph (struct it *it)
 
       if (face->box_vertical_line_width > 0)
 	{
+	  if (it->glyph_row)
+	    it->glyph_row->have_glyph_with_box_p = 1;
 	  if (it->start_of_box_run_p && slice.x == 0)
 	    it->pixel_width += face->box_vertical_line_width;
 	  if (it->end_of_box_run_p && slice.x + slice.width == img->width)
@@ -29629,6 +29633,8 @@ produce_xwidget_glyph (struct it *it)
 
       if (face->box_vertical_line_width > 0)
 	{
+	  if (it->glyph_row)
+	    it->glyph_row->have_glyph_with_box_p = 1;
 	  if (it->start_of_box_run_p)
 	    it->pixel_width += face->box_vertical_line_width;
 	  it->pixel_width += face->box_vertical_line_width;
@@ -30393,27 +30399,29 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym)
 /* If face has a box, add the box thickness to the character
    height.  If character has a box line to the left and/or
    right, add the box line width to the character's width.  */
-#define IT_APPLY_FACE_BOX(it, face)				\
-  do {								\
-    if (face->box != FACE_NO_BOX)				\
-      {								\
-	int thick = face->box_horizontal_line_width;		\
-	if (thick > 0)						\
-	  {							\
-	    it->ascent += thick;				\
-	    it->descent += thick;				\
-	  }							\
-								\
-	thick = face->box_vertical_line_width;			\
-	if (thick > 0)						\
-	  {							\
-	    if (it->start_of_box_run_p)				\
-	      it->pixel_width += thick;				\
-	    if (it->end_of_box_run_p)				\
-	      it->pixel_width += thick;				\
-	  }							\
-      }								\
-    } while (false)
+#define IT_APPLY_FACE_BOX(it, face)					\
+  do {									\
+    if (face->box != FACE_NO_BOX)					\
+      {									\
+	int thick = face->box_horizontal_line_width;			\
+	if (thick > 0)							\
+	  {								\
+	    it->ascent += thick;					\
+	    it->descent += thick;					\
+	  }								\
+									\
+	thick = face->box_vertical_line_width;				\
+	if (thick > 0)							\
+	  {								\
+	    if (it->glyph_row)						\
+	      it->glyph_row->have_glyph_with_box_p = 1;	\
+	    if (it->start_of_box_run_p)					\
+	      it->pixel_width += thick;					\
+	    if (it->end_of_box_run_p)					\
+	      it->pixel_width += thick;					\
+	  }								\
+      }									\
+  } while (false)
 
 /* RIF:
    Produce glyphs/get display metrics for the display element IT is
@@ -32044,7 +32052,75 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
 			  enum draw_glyphs_face draw)
 {
 #ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (XFRAME (w->frame)))
+  /* Basically, when have_glyph_with_box_p is true,
+     we know we are dealing with a row that has at least one
+     glyph with a box line.
+
+     As such, for each glyph within the highlighted region that has
+     box lines and is the start of a box, we subtract the width of the
+     lines from its pixel_width.  */
+  int remove_p = draw != DRAW_MOUSE_FACE;
+
+  if (row->have_glyph_with_box_p &&
+      FRAME_WINDOW_P (XFRAME (w->frame)) &&
+      remove_p == row->mouse_face_glyphs_processed_p)
+    {
+      struct frame *f = WINDOW_XFRAME (w);
+      struct face *mouse_face =
+	FACE_FROM_ID_OR_NULL (f, MOUSE_HL_INFO (f)->mouse_face_face_id);
+
+      if (mouse_face == NULL)
+	mouse_face = FACE_FROM_ID (f, MOUSE_FACE_ID);
+
+      int end_of_modified_glyphs = start_x;
+      struct glyph *g = NULL;
+
+      for (int i = start_hpos; i <= end_hpos; ++i)
+	{
+	  g = &row->glyphs[TEXT_AREA][i];
+	  struct face *mouse = mouse_face;
+	  struct face *regular_face = FACE_FROM_ID (f, g->face_id);
+
+	  if (remove_p)
+	    {
+	      if (g->type == CHAR_GLYPH)
+		mouse = FACE_FROM_ID (f, FACE_FOR_CHAR
+				      (f, mouse_face, g->u.ch, -1, Qnil));
+
+	      struct face *temp = regular_face;
+	      regular_face = mouse;
+	      mouse = temp;
+	    }
+
+	  /* If the glyph has a left box line, subtract from it the
+	     original width of the line. */
+	  if (g->left_box_line_p)
+	    g->pixel_width -= max (0, regular_face->box_vertical_line_width);
+	  /* Likewise with the right box line, as there may be a box
+	     there as well. */
+	  if (g->right_box_line_p)
+	    g->pixel_width -= max (0, regular_face->box_vertical_line_width);
+	  /* Now we add the line widths from the new face. */
+	  if (g->left_box_line_p)
+	    g->pixel_width += max (0, mouse->box_vertical_line_width);
+	  if (g->right_box_line_p)
+	    g->pixel_width += max (0, mouse->box_vertical_line_width);
+
+	  end_of_modified_glyphs += g->pixel_width;
+	}
+      row->mouse_face_glyphs_processed_p = !remove_p;
+
+      /* Redraw the entire row so changes are taken into effect. */
+      draw_glyphs (w, row->x, row, TEXT_AREA,
+		   0, row->used[TEXT_AREA],
+		   DRAW_NORMAL_TEXT, 0);
+
+      /* Now draw the mouse face area. */
+      if (draw != DRAW_NORMAL_TEXT)
+	draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
+      return;
+    }
+  else if (FRAME_WINDOW_P (XFRAME (w->frame)))
     {
       draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
       return;
@@ -32067,6 +32143,8 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
   struct window *w = XWINDOW (hlinfo->mouse_face_window);
   struct frame *f = XFRAME (WINDOW_FRAME (w));
 
+  int unblock_flipping = 0;
+
   /* Don't bother doing anything if we are on a wrong frame.  */
   if (f != hlinfo->mouse_face_mouse_frame)
     return;
@@ -32148,6 +32226,19 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 
 	  if (end_hpos > start_hpos)
 	    {
+#ifdef HAVE_WINDOW_SYSTEM
+	      if (FRAME_WINDOW_P (f) &&
+		  w->phys_cursor_on_p && MATRIX_ROW (w->current_matrix,
+						     w->phys_cursor.vpos) == row)
+		{
+		  /* Helps reduce flicker. */
+		  unblock_flipping = true;
+		  block_buffer_flips ();
+		  /* The cursor's position will be changed later, and if we don't clear it now,
+		     artifacting can result. */
+		  gui_clear_cursor (w);
+		}
+#endif
 	      draw_row_with_mouse_face (w, start_x, row,
 					start_hpos, end_hpos, draw);
 
@@ -32173,6 +32264,38 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	    hpos = row->used[TEXT_AREA] - 1;
 
 	  block_input ();
+	  /* If there's a row with a box somewhere, by all likelyhood
+	     the dimensions of the row has been changed.  If that is
+	     the case, and we also find a row where the phys cursor
+	     is, recalculate the dimensions of the phys cursor. */
+	  for (row = first; row <= last && row->enabled_p; ++row)
+	    if (row->have_glyph_with_box_p &&
+		MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos) == row)
+	      {
+		int cx = 0, hpos = 0;
+		struct glyph *start = row->glyphs[TEXT_AREA];
+		struct glyph *last = start + row->used[TEXT_AREA] - (intptr_t) 1;
+
+		while (last > start && last->charpos < 0)
+		  --last;
+
+		for (struct glyph *glyph = start; glyph < last; glyph++)
+		  {
+		    cx += glyph->pixel_width;
+		    ++hpos;
+
+		    if (hpos == w->phys_cursor.hpos)
+		      {
+			w->cursor.x = cx;
+			w->phys_cursor.x = cx;
+			goto set_cursor;
+		      }
+		  }
+		/* Why was the phys cursor glyph not found, even
+		   though the phys cursor is on this row? */
+		emacs_abort ();
+	      }
+	set_cursor:
 	  display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
 				  w->phys_cursor.x, w->phys_cursor.y);
 	  unblock_input ();
@@ -32197,6 +32320,9 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 	FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->nontext_cursor);
     }
 #endif	/* HAVE_WINDOW_SYSTEM */
+
+  if (unblock_flipping)
+    unblock_buffer_flips ();
 }
 
 /* EXPORT:
@@ -32209,12 +32335,23 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
 {
   bool cleared
     = !hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window);
+#ifdef HAVE_WINDOW_SYSTEM
+  bool cursor_was_in_mouse_face_p =
+    cleared && cursor_in_mouse_face_p (XWINDOW (hlinfo->mouse_face_window));
+  struct window *w = cleared ? XWINDOW (hlinfo->mouse_face_window) : NULL;
+#endif /* HAVE_WINDOW_SYSTEM */
   if (cleared)
     show_mouse_face (hlinfo, DRAW_NORMAL_TEXT);
   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;
   hlinfo->mouse_face_overlay = Qnil;
+#ifdef HAVE_WINDOW_SYSTEM
+  if (cursor_was_in_mouse_face_p)
+    set_cursor_from_row (w, MATRIX_ROW (w->current_matrix,
+					w->phys_cursor.vpos),
+			 w->current_matrix, 0, 0, 0, 0);
+#endif /* HAVE_WINDOW_SYSTEM */
   return cleared;
 }
 
-- 
2.33.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 05:48:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 19 01:48:15 2021
Received: from localhost ([127.0.0.1]:37340 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRpgV-0001Vm-2j
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 01:48:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44808)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mRpgS-0001VU-1R
 for 50660 <at> debbugs.gnu.org; Sun, 19 Sep 2021 01:48:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47028)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mRpgM-0008Ab-PX; Sun, 19 Sep 2021 01:48:06 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3927
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mRpgK-0004y3-Ag; Sun, 19 Sep 2021 01:48:04 -0400
Date: Sun, 19 Sep 2021 08:47:54 +0300
Message-Id: <831r5l5d6d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <877dfdz9ni.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#50660: 28.0.50;
 Text artifacting when the cursor moves over text under mouse face
 that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN> <877dfdz9ni.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: larsi@HIDDEN, 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 50660 <at> debbugs.gnu.org
> Date: Sun, 19 Sep 2021 08:33:37 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Lars Ingebrigtsen <larsi@HIDDEN> writes:
> 
> > Note the little dots above to the right of the Zs.  I don't think those
> > should be there, so there might be a off-by-one error (or something)
> > when computing something here...
> 
> That is probably the same bug, though in a different form.  Thanks.

Feel free to dig in the display code involved in this, I don't intend
doing that any time soon.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 00:50:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 18 20:50:19 2021
Received: from localhost ([127.0.0.1]:37210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRl2B-0002ff-6O
	for submit <at> debbugs.gnu.org; Sat, 18 Sep 2021 20:50:19 -0400
Received: from sonic316-21.consmr.mail.ne1.yahoo.com ([66.163.187.147]:39215)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mRl29-0002fN-1f
 for 50660 <at> debbugs.gnu.org; Sat, 18 Sep 2021 20:50:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632012610; bh=eBF7/O3Kc0I8fzFaQHzg0OgS/Qw6VJcOQxvEjJBfhpc=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=F5EHuDU8BopRaSx6Z85JqA+QrQ5TYKhZzXqsMp8I2miOQ73XNZPP6sufHKOoWQNzvannqmsCIOao++oHN9mydrG5QcapJIk0Ys8ORa8C9DrGmT6QmHv4W2wYyhwy7QI4e02a7It2IA2EmgTkQzgLFEk1Web0eIPiudCtYnSwPaoZfgoLm+pXjzFrm9/bVfN431C6nya7VJ0qGaPAHAVelYCzinaM+doQuE3Z/1SrtspUz/WSQ66RxZdCzUVBHaepSVWVMeKi9dTNNTTzuoimLJm2Dic36tYol2tyxSTFw3eBld79Olxaroq/oU+lhfXYIqUeqBVhvxPG8U7I2IXJkw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632012610; bh=xOcHRPF+r3RcvSQqQ7MzYrPLp/Uhl/eAZlaCmZmNu8B=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=tUCYO7irLTD8g4FupeaECUjYS/YXzZhYTEi1B5k5bJOCqHSMQkKhPi7yDGZ4X+/OylZa7McmaR/KXdsf5ilocJ3ii6UGwj3uoupCSEmDehQyj/0kPT53WBiyheO0Fq7/Jp57Mz8XnxiWjxD2TWFp5illVM8VhXdqZ9h4fMmcLEv6P5QXg33K4UQvnIVea+QYCZWkahYO9UQXdrin54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LAvGWHr82
 jj9KjSUJoJSEnW4Q.ImaNbZy9LRwzXSQ5vjAMGyNWJcSWvEw36fiKKLHtwKY4sTwbspJo.zp0TGs
 7kl6AldAK2ifeFnYhCVosAfm4t97VyGVohotkRMzYtwBpsc5Kb65qQBVWdupJQ9m1vb4y_kICm7m
 ItrT0tZzCibhtB9MnnugwtTL0tCGgdy6hxX6pVkdYF8PM5PSqSAitKHYQLQCg6OHU7tzQA7LZPkE
 ZMohivGuBM34xiI6COdCilw7a9uEulIApq9Qlvlff2L5NEa91ge.RrErhCVUtxa7pL3Q-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic316.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Sep 2021 00:50:10 +0000
Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 2a0473981971fe031447a156555553bb; 
 Sun, 19 Sep 2021 00:50:06 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN>
Date: Sun, 19 Sep 2021 08:50:03 +0800
In-Reply-To: <87y27uro4c.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 18 Sep 2021 15:48:19 +0200")
Message-ID: <871r5lz8w4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 391
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> I do see one odd thing here.  When marking a region with the mouse, I
> get this:

But wait a second... What do you mean by marking a region with the
mouse?  The recipe I provided is to hover your pointer over the sample
text, and then to move your (Emacs) cursor over the sample text.

Could you please try that, and see what happens?  Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 00:33:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 18 20:33:56 2021
Received: from localhost ([127.0.0.1]:37199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRkmK-0002GZ-FU
	for submit <at> debbugs.gnu.org; Sat, 18 Sep 2021 20:33:56 -0400
Received: from sonic310-25.consmr.mail.ne1.yahoo.com ([66.163.186.206]:42162)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mRkmI-0002GF-Lc
 for 50660 <at> debbugs.gnu.org; Sat, 18 Sep 2021 20:33:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632011628; bh=oCuZ0nKfJSguWBBMnXRur5XnhnDuNXBTil63ys+vRa8=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=LrClwBwQnNTfV5VdUgzkry6xK5i/qp2Cv7UzaXSjZReHRTXM1Z0DDCMDPP94ZGS1xM71tGY64z9Xd2CV5FmNKA1s3tj6xKdRoLVq7WOexYnqoPU5gQMsbBmRRdxsiSqQjkUd4BS8MrIfTLhZYljV0cNjrcUDiSQWVzfkX3ifM3inJbd/5U6Tx4qniiIr0+kcWshu9ZsoSk8YuKjlxFK+2XgSfWIT8euh9T8FTmZjHKWncIxXDlq8IwdQSdjdpR87nWfT+vzXGMdpbqNQQi6y8nNDOJ/EzFhwLRHF1bNsmIAQ42nPgGFVF/iiP4WZz54fbQL/AQcclF9Ab2ICsnANjQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1632011628; bh=RuTu/ZntMwPf3BTHaKlb9nr5P/27AwuRKPACxOOiyS1=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=Qx5RMLg4ncAnPBXRT+r+9oOIq/qIoPAB4roYuYrPyHrDKm8IlIgxBWRvZywTSPltEIW98UnSapaLiaOXWa55moEQ1LxaQJ0+fP+E+llIKpS0dxGjiIE0bP5Fh+rIGp63Oo+qV+2CSJm4oaEwHPKJfuRRdbYfNH93AePo9HJpeTqoVf7u/P7dozu0nAz6+GiY1e/swRmMVDZz4hdgHKrF8Zo7D95XkRgypE5N3BTCeot3os1q8MnUeBd5ISiiHbfScoz3/Rt0UHVi4lCOAn1FtPwonD1ZNZf4mAoGlQ6fcYa7K3Od0nuET5PgnkBFINIDdTefjcKnHmeEQFEzUZwgBg==
X-YMail-OSG: jIXd4FYVM1ko4dbOfK2p3a6wk8bK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7wx9RfJPjo
 HHKfOAm9oVOvoMcH_eHTCIXVugQAoZPo0a8q8Xl62pBAtX7v6pZkYIQV29wWFWy0gFtyyVe_gi3E
 mFrY4J6L1yxDMQs5D.QoutNsZjnwcU3QmvGygYdayTSy1KXw4Wroc49i_xTMA2E1fvo.E36psjgn
 9gK8UMLUyufRo6krXgkCq5i.zBGPJdSPS7C2lDjE3uh9CRKC7N8enCFtouvtSbOTgc.LWdM8v.mf
 5K6GYqI2ETd5RnPsSH60-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Sep 2021 00:33:48 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID d08a83fa19e73cd2c8eb3e58965cead4; 
 Sun, 19 Sep 2021 00:33:41 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
 <87y27uro4c.fsf@HIDDEN>
Date: Sun, 19 Sep 2021 08:33:37 +0800
In-Reply-To: <87y27uro4c.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 18 Sep 2021 15:48:19 +0200")
Message-ID: <877dfdz9ni.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 293
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50660
Cc: 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Note the little dots above to the right of the Zs.  I don't think those
> should be there, so there might be a off-by-one error (or something)
> when computing something here...

That is probably the same bug, though in a different form.  Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at 50660 <at> debbugs.gnu.org:


Received: (at 50660) by debbugs.gnu.org; 18 Sep 2021 13:48:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 18 09:48:31 2021
Received: from localhost ([127.0.0.1]:33895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRahj-0001oZ-3k
	for submit <at> debbugs.gnu.org; Sat, 18 Sep 2021 09:48:31 -0400
Received: from quimby.gnus.org ([95.216.78.240]:58002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mRahg-0001oI-K9
 for 50660 <at> debbugs.gnu.org; Sat, 18 Sep 2021 09:48:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=htXAeEdTwzn5pLiPfD+qWD6Lezc3MB5/u2vmu5Fp0eU=; b=Di3QTYSdD62LA4dali9Zn/4ulK
 tuLZiTT+2r3kTsn1Djl4cb4jjZvFWsE73IAQ9/6+p7OUt8vUrXzM+pTKtTdeUxrADXqrfB5vtRdPy
 0WfLTT22tWEajHCTLlZsYiMBHS2yiiTUALULZ6Mm1X7PE5UWdc5fTsjxeW4s6wug/jEk=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mRahX-0003qE-IC; Sat, 18 Sep 2021 15:48:22 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#50660: 28.0.50; Text artifacting when the cursor moves over
 text under mouse face that originally displayed a box
References: <87czp6ysw7.fsf.ref@HIDDEN> <87czp6ysw7.fsf@HIDDEN>
Date: Sat, 18 Sep 2021 15:48:19 +0200
In-Reply-To: <87czp6ysw7.fsf@HIDDEN> (Po Lu's message of "Sat, 18 Sep 2021
 20:23:20 +0800")
Message-ID: <87y27uro4c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > If you're lucky, you
 will be able to observe artifacting, usually around > the characters "O",
 "Q", "R", "W", "X", "Y", and/or "Z". If you're not, > you can usually at least
 observe the text being r [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50660
Cc: 50660 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Po Lu <luangruo@HIDDEN> writes:

> If you're lucky, you will be able to observe artifacting, usually around
> the characters "O", "Q", "R", "W", "X", "Y", and/or "Z".  If you're not,
> you can usually at least observe the text being redrawn in a manner
> inconsistent with its surroundings, where characters surrounding the
> cursor appear to be spaced overly close to or overly far from their
> surroundings.

I can't reproduce this -- perhaps it's dependent on which fonts are
used?

I do see one odd thing here.  When marking a region with the mouse, I
get this:


--=-=-=
Content-Type: image/png
Content-Disposition: inline
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAC0AAAB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wtMCACs4ZVf4XDwA9FSeMFC8YBxXbU/wJAOAsuHwv04LtJP1Wy2/+OkG
KG9kH68fXROgbaX5V/sAwMrN1QEANE2nTjaox1EwQz6In0sGgP66rNSznZO6GX8SPywdHKxG/IXm
YDMuqiifbAkAgLjiRLlonCLm6pQ4DyIA9Namf10hNimOERfEbfAij4zMWLfRf9zZhwrOnP5RB8I/
d7px7GYg00P/un4WAQBk1fvSqqUAJnBg3cI3+VMBQNb8cwcKQJq/IY5LHrclipHscEAxNk1EnMNT
omcSAEBUsSe9Rm5aXLdfkRTK1vnq7n8crpYDgO3SxHXuxt7Z41zCU6JeJgCgnWWpGbdM+NEWAOCs
FsZHzSUAaHlFmedFCu3R4w1vbPUkTg/dtOL89lIjoiVj9QfvuuMBQNvZqvRYGzkq5xHdLq5oNqZv
gYtO8H3iqzwtAIgrMotWHIx2xc+OTFh08YurE5YjdBZT16pAGN6h0d6jJ+8qSo3jQFY4AYCy9pmv
annFWeViALBanBg12drSZDHnY2YOM4eZ40XnMNcNo8VcN4yzU3PdMM5vzXXDaA5z3aDHYa4b9DnM
dcNopzfXDWaOF4ED/V3E3d29rKzsNzj+C2qBjxfYQopvAAAAAElFTkSuQmCC
--=-=-=
Content-Type: text/plain


Note the little dots above to the right of the Zs.  I don't think those
should be there, so there might be a off-by-one error (or something)
when computing something here...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Sep 2021 12:23:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 18 08:23:35 2021
Received: from localhost ([127.0.0.1]:33782 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRZNX-0005vl-6d
	for submit <at> debbugs.gnu.org; Sat, 18 Sep 2021 08:23:35 -0400
Received: from lists.gnu.org ([209.51.188.17]:49296)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mRZNU-0005vc-FV
 for submit <at> debbugs.gnu.org; Sat, 18 Sep 2021 08:23:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34546)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <luangruo@HIDDEN>)
 id 1mRZNU-0002sd-92
 for bug-gnu-emacs@HIDDEN; Sat, 18 Sep 2021 08:23:32 -0400
Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:38275)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <luangruo@HIDDEN>)
 id 1mRZNS-0000Fv-27
 for bug-gnu-emacs@HIDDEN; Sat, 18 Sep 2021 08:23:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1631967808; bh=uGyQBjkjJVTT5rmLS6x1QTwVW3/FJwE+ksIyRwmsnXs=;
 h=From:To:Subject:Date:References:From:Subject:Reply-To;
 b=h4OCFuKWjjJwTtCEePQMF1v9QY3XVjLkbUvsb5o/Od8ksxgVolIP5teqr9ZVadcgeekuuedt/f3Fn03mDFrYuebNkYRyKaje0/ymCLjx7lK5B8XQ3eI2b1i4rUZ9hpmbuhg+f1rwqENoEONUvTLbpVUGL/6Oil/9U46rNEZd0dzBD0H+q35/Mn8m9o+anhnBs8PVAIL0LzvNFpS43A3YbsEOl3eWTSUnFXwscJYtpJCoymcDQ2m8O8ZWAxPqra8Z7IZSDhO70xNPsuElj/W57oGn7K6MFTbZ+d8Gt/F23Z5b5snFOUHSYjWcidgKzmmivJMbXCcVdfIAN6H4o3sb1A==
X-SONIC-DKIM-SIGN: v=1; a=r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HL9I7hnX8dweKSGe3liSMXIrpitE_yrGC.DWtIw.
 VKrmOT1hfDe90gkVVAs0NJ4IJg9PI7foJVfxcBqkRTWmC5CWHTIOCjOy55wpwgX1lRpO6j3Yzibs
 qcYV3dd0PtgPIXO.Lq1AQho_yNJap0DfWpsSSSSMOsfsIPZ4ngKyYwtgl2p0JPtzQR92nWWeGEjv
 XBfRTpsMnvqWGPuWUHlR6UDTUgxUUZp.lL06fCTmJwrlVkyapj.yGDg9yvq7e.WQTuMsEYy0SzVU
 P744IWbaTDwZZ_.nnxXUbZ.oU4ROd1bsKHgDMB420CEUyWPZc4V5OWbB.M0YgJedrp3WsL5jF0hL
 lbyCa409dJyrQA2M5mD.1lMsGFTJNhZRsYDTtvfNRLo4gadrIdwNCMc1ZFU2nDwbEUXwEFOqWvua
 lr85cEM7HGKEQ4jzD_EhBx9GBvTjN5tQaeV1wqMsuZHW6p366MANVsLPXKuckU9c6i6upC9atvUe
 T1R0LGA5ABNGTHbWHGqFo3KYCGRDUHtGCjNwBd2GjakonvtxKCUGquBHKleQpAf39aaOUxm1CT8a
 26EFrnplTKlTViq2zMqD2M5yrhvmE2NgNH8nxGrPAhXdj_kyitAhyCf539stS.dkz47PtiNpqw5l
 bHaWcYaE7.TDSA1gY_CVSQ6oRddH1eyP3cvS54CdK7nOC6Ai0lf0OxrLzZIoHdpMS
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 Sep 2021 12:23:28 +0000
Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 3af83dc72e02db10b588d488086db307; 
 Sat, 18 Sep 2021 12:23:24 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Text artifacting when the cursor moves over text under
 mouse face that originally displayed a box
Date: Sat, 18 Sep 2021 20:23:20 +0800
Message-ID: <87czp6ysw7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
References: <87czp6ysw7.fsf.ref@HIDDEN>
X-Mailer: WebService/1.1.19013
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 4978
Received-SPF: pass client-ip=66.163.190.31; envelope-from=luangruo@HIDDEN;
 helo=sonic307-56.consmr.mail.ne1.yahoo.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.6 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.6 (-)

--=-=-=
Content-Type: text/plain


Start Emacs with -Q, run `list-faces-display', move to a face with a box
defined (for example, mode-line-highlight), highlight the sample text
with the mouse, and move the cursor around inside the sample text.

If you're lucky, you will be able to observe artifacting, usually around
the characters "O", "Q", "R", "W", "X", "Y", and/or "Z".  If you're not,
you can usually at least observe the text being redrawn in a manner
inconsistent with its surroundings, where characters surrounding the
cursor appear to be spaced overly close to or overly far from their
surroundings.

I've attached a screenshot depicting the results of moving the cursor to
the end of the sample text for mode-line-highlight while under mouse
face, and then quickly moving the cursor to the next line.  Note the
artifacting to the left of the character "Z", and how "Z" appears to be
spaced further apart than its neighbors to the left.


--=-=-=
Content-Type: image/png
Content-Disposition: attachment; filename=artifacting.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAADcAAAA0CAYAAAAuT6DoAAAABHNCSVQICAgIfAhkiAAAABl0RVh0
U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAJfSURBVGiB7Zo9coMwEIWfGLpUSeveF/AF
7DoZDsuQmjOkda/WOYLSRERe6+cJJDtm+GY8EfIK7dtdFjNBGWMMVkrzaAdqogAYALAJVEpFFyy1
M8ZE15YspEaeUI5j382xc7Hral0ZU1kqpYIR9WXBjn3Op+wkjM0cWtbQlpPr+Fxn3HWp8l5CVkOJ
lZicdwPBBKFGaTbWEUuJEmGCUGqvGFPmmAvbF4S51CxHC12WbpTZ2wGDr4xLQYljOyNL7XK0JLul
LMVQuw+JjQmpXZpq+235pKxaXPv5/floHyjeX9+z16w6c5u4Z2V6WB0uAz7ePq6+lHPDZZjGcp61
s3O+/eTeLnOuOTVchpv7nN08dFzKjrUHFjaUVBTl9z4HWLsYufYx6GvOdXypA3atPEdJYcCvOOYa
sM6kHJgbhNLCgErdkgnCPcgSx2Y4l1qBaNwTsx2spEDffqXOTWWO7YwspRpTiuTDasiR1Lw7jgko
XeIu3pv4f2R7KhBs4p6VVYtrX75e7r7p6XSi7MZxxPF4nL1Pu9/vZy/+77Rd100Hfd/DPfbN9X0/
jWNrY3YAoLUOOrXb7XI0hDkcDkZrffOR8yXtAEx/5cedH8fRLOGqocisufiy2nXdVYZy7Hxorctl
DZnd0nWcdTiEFFFaGOCIs87Gsgf8CYwJyw1CDWFAxfscE4TaZItjM8xSK2sA0MgIxyLus1uCT1js
FpELnTm2M7LUzJiFeg8l1BxS8+7YVwkls+RD/d407wqbsaW/Ldf9VHA+nx/tQzW2f/g/K1cvk6Ze
/Ay9bZdjJ+ckJQvpB8Zyg6TljCOOAAAAAElFTkSuQmCC
--=-=-=
Content-Type: text/plain


In GNU Emacs 28.0.50 (build 1, i386-pc-solaris2.11, X toolkit, Xaw scroll bars)
 of 2021-09-18 built on blaster
Repository revision: 93731cdae0ff11d9f67e06ed3ea75b1320ce5034
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12101001
Configured using:
 'configure --with-gnutls=ifavailable --disable-acl'

Configured features:
GIF JPEG MODULES PDUMPER PNG THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE
XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date misearch
multi-isearch help-mode info sly-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
dynamic-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 70437 15727)
 (symbols 24 7754 1)
 (strings 16 24397 1118)
 (string-bytes 1 758560)
 (vectors 8 16650)
 (vector-slots 4 258394 24378)
 (floats 8 38 22)
 (intervals 28 786 0)
 (buffers 564 13))

--=-=-=--




Acknowledgement sent to Po Lu <luangruo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#50660; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 14 Oct 2021 12:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.