From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50660: 28.0.50; Text artifacting when the cursor moves over text under mouse face that originally displayed a box Date: Mon, 20 Sep 2021 16:02:02 +0800 Message-ID: <87a6k765fp.fsf@yahoo.com> References: <87czp6ysw7.fsf.ref@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12376"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 50660@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 20 10:03:48 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSEHE-00031D-1A for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 10:03:48 +0200 Original-Received: from localhost ([::1]:35552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSEHC-0008MF-Rr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 04:03:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSEGU-0007zI-Ip for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 04:03:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSEGU-0006hG-BG for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 04:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSEGT-000860-V7 for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 04:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Sep 2021 08:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50660 X-GNU-PR-Package: emacs Original-Received: via spool by 50660-submit@debbugs.gnu.org id=B50660.163212494231056 (code B ref 50660); Mon, 20 Sep 2021 08:03:01 +0000 Original-Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:02:22 +0000 Original-Received: from localhost ([127.0.0.1]:40924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSEFp-00084q-Sq for submit@debbugs.gnu.org; Mon, 20 Sep 2021 04:02:22 -0400 Original-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 ) id 1mSEFk-00084Z-QZ for 50660@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: SHc8nJsVM1k9oz1uPdrSfwfz1bNwEIs_.xSTvMbQIdVRRDPpKkgNpAlNTShT935 oH_2tFg5PeAdv_Zl26CdiYuW65si.P6HZcuLOgKvTELcqPyHEV3GNh83Y4Mora5.5EXv6KqG5MrU 3I7gXzeF_f3nl7EDVMX5TrepRRxFu2En1mGgnFNya06Di3BaZvwozaU5niOUa._ho6vemMvk6P8F 1iZfwbGLhXTGmBpF41eOjAfVP6_9wGkF45HPUWONpjYBssbpB0YZvuPTdnpqQjzMxfhRGrqSuSAB 5HKT_z6lp40bt9j6MHqQqFOjMaHh6dNmAsZx7yy62UrByUtEv1PD5yCjdMp1Dr.zbXjEhpxVwjYq YwkN3g1O5u_mtyhPazcChysZ4tHfKn4iy3nuVmE_txNckdKLfOW3h0mZPtbokr_AdQvWQbKeGfBK 1Cfv89FitdmLftgz3D32B0o4RkTYGy521zuL7tsXR0_KYp2OoQQ8Oxd9.g_39gwScPEOA.DOMARJ 9YkMMr_U85N.73d1rQwQpoVhBNLvi.96VqN7zwopIy5FuqC16OfzmAby3uoE6CdSgtaS1Puix4dl qp6QkRqo9qdrvut6ZMnAs.X_Qr3r9UhrM0FSfMIWAvgX0AEnSIOKG4l4ZjxwVKGjqNZA4n49mrF2 pm8FwCnrPLmt3ZjssVCv5Zicz9tFaqZFgdKEMcSdMdLs2HSMl9Xda6ncBohP0JQ0qQ4vRLk02d5u V4iZE6dB5CxuKOqtQBTRsMQsZXodiPOsYKnuBAvwKbflPgebHthbUuM2zR8EB336qdtgPpqHSDGk XFn8gMJSM7ljA66HiRVZ33IYeAZTtn.MWqOGoEycmC X-Sonic-MF: Original-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 Original-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) In-Reply-To: <83ee9j3ju3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 08:19:16 +0300") X-Mailer: WebService/1.1.19013 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214845 Archived-At: Eli Zaretskii 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?