From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 18 08:23:35 2021 Received: (at submit) by debbugs.gnu.org; 18 Sep 2021 12:23:35 +0000 Received: from localhost ([127.0.0.1]:33782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRZNX-0005vl-6d for submit@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 ) id 1mRZNU-0005vc-FV for submit@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 ) id 1mRZNU-0002sd-92 for bug-gnu-emacs@gnu.org; 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 ) id 1mRZNS-0000Fv-27 for bug-gnu-emacs@gnu.org; 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=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1631967808; bh=jn7aF4UCIt/AviOXX/jSrOkYU54Cmx0i6pU1j1KtVjB=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=KpTWmJKl0M1IT6I10DacxfdxeOnNyscmRx2GY73L2Bw4CPDuVoEL8re2fHNmbzC3UiaEAIFJ8D/pdV1+Faf+vu/Xh2BmDTLJPMkhGYGgwRI3vMDPR/sTbjEk6PCy64NkXNBqGlw1ycc1NW30lstGxMT6T70hQ0OZ+RzesbvohMCvlDU51Td35XyeXtzuq/50O5iDVf+3CNNAVoNsOhChRL16sLQo/pJ2dzYa5L7kUrqogHKE7sE0Epju3g6yFQdPgK/pVGEqOcwTQ6SB+zxuapXl1feIlQm8QkUU+2rfw1oUHxVgfaoBcVWJiX3XXPjzbdVgiuhzOmxRz3Uayyktxw== X-YMail-OSG: 04nPX8MVM1kr9hl0fW4rKlWclXwG6cuEUdl2CmNUBqZLG4jI8OCxT5851Kc.lSM lrzmK1BzYe8NBw.tLJuaeRaUWwAQYaBBauApHAiNiSG_h8PWJoYBeEBx42DXRvk370OOA5Mc00bR GnZj4ftxw241_6a.z7Qh1e7thXWdNRovs4BfejHZysr3bUgimMiy5HcC960nYCzXu0HrKMVqX714 lW9sT8y2Ceb8A5Z8saJfY8bWGLowdBC2d0Q.H6gZdtgjrMoyvy9_hFn4UlCVIUdr2LrMGE5VY0gc O6Cne.xvkPuPsI8384deQUsz95t3tr_MelGXXJbRySpzz.F.beeJBAhTE9hGzXinHScBWYJ3TKFs j7QvWItsMF9AT3PCbw3IgbAvWF69I0zuqmu8Cf48wRMMzE6tB4Rwfhbcr2rclliA73_5xxLaVq.b PnBrNVyGgZ_FfftVtmaFnZFvobZgRVtDMnJOBmKKHv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1SsjRZ2GuZ9jFyo5QLz9duETwh9pWL TMmA.CGroa39WnV5TLzFp5HHmddqjX5nXgCsHL9I7hnX8dweKSGe3liSMXIrpitE_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: 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 To: bug-gnu-emacs@gnu.org 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@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: <87czp6ysw7.fsf.ref@yahoo.com> 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@yahoo.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 18 09:48:31 2021 Received: (at 50660) by debbugs.gnu.org; 18 Sep 2021 13:48:31 +0000 Received: from localhost ([127.0.0.1]:33895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRahj-0001oZ-3k for submit@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 ) id 1mRahg-0001oI-K9 for 50660@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 ) id 1mRahX-0003qE-IC; Sat, 18 Sep 2021 15:48:22 +0200 From: Lars Ingebrigtsen To: Po Lu 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> Date: Sat, 18 Sep 2021 15:48:19 +0200 In-Reply-To: <87czp6ysw7.fsf@yahoo.com> (Po Lu's message of "Sat, 18 Sep 2021 20:23:20 +0800") Message-ID: <87y27uro4c.fsf@gnus.org> 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 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Po Lu 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 iVBORw0KGgoAAAANSUhEUgAAAC0AAABrCAIAAABseZy8AAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAA EGNhTnYAAAeAAAAEsAAABpgAAAJwggJU7gAACqxJREFUaN7tmnlUk1cWwG++7IAQSCCQmIRFWseK opaUUpVaBIWqoAKWsogsomPRaaUzTjttPdbOaYceFaUCLoggKDBFtFJZVHQUsYoFLFrUYgIJiyRk YUlIAvnmj6AGSEvIGUs9k/tPOO+93O/H++697953g/Hy8gIAwLrGZhyIoKsHSXhhXnLyCZ4W9AVx i0lPj6Rf37NXHv3x25jyv8WlNajAgFB8Pzuyw0dz6ZPE1Jv9YLwgI5/DjwoLrmtIJJLiP7lFYyAA QNtSeKiyx2Lhth2B9gM1R3IMQ4D1oi2bfaZJL6RlTgpCjwPjGLiSiwcAC27gYlsDC1UNx47f0mCx mIfFRy7LDeqy8t743mIbycUDGTf6AEzioC3bEjMbL/g2rbiV/HpCPNfCwFJZe/sAANrR0YEa0mSx IGmrH0V6OS2jth/AJA6K75aEV8mi8gO55fmHqqS2fptjXiFMTg9pXkJyAFV2ab8JezHCYeWTlOQz TV6dcaxxEJR1x3NuKxnBW8JdEOO1ED1i/xJEl1anH7zeCyYJQp63YctbtgM3s7NqdP+ItDKrmAcu 695bRTdSB35m7PsrHeVX9h+s6QMTBbc+OZCmuXvwYJX0qW+0fpt1PvDLt6M2L72y84J0QhWM4KQQ JqLkkX02bvcZMye58XV2jVEcwUztL7nffNepb3vq+tycm0s+fD0hgVubenNgAhXWdrYIANmF6+8y bk4oNpIDMxLHplqQPwKEmcPMYeZ4ITkwdGLdY80j9uxUOv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vJ0qa7Nz6gcBEE7YrtQYTyKAlleU dV40sgJtPZ13tR8ASK+Fh7hSl0X42wGA5m7hyR81482NHrQ9aYEFAKibj311ijc0KX/pqcosbNEC EO3trQGgpzJrVE2guJZXwtMCACs4ZVf4XDwA9FSeMFC8YBxXbU/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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 18 20:33:56 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 00:33:56 +0000 Received: from localhost ([127.0.0.1]:37199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRkmK-0002GZ-FU for submit@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 ) id 1mRkmI-0002GF-Lc for 50660@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/swRmMVDZz4hdgHKrF8Zo7D95XkRgypE5N3BTCeot3os1q8MnUeBd5ISiiHb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D_GdWBLhgKLeQlrjdjOjzY1 KXyc1jr_wED29pgJP0tSzvn8LUjHlZq8bLquPAxq7q4c997J1gQa_IYxx78elN56UB7wx9RfJPjo HHKfOAm9oVOvoMcH_eHTCIXVugQAoZPo0a8q8Xl62pBAtX7v6pZkYIQV29wWFWy0gFtyyVe_gi3E mFrY4J6L1yxDMQs5D.QoutNsZjnwcU3QmvGygYdayTSy1KXw4Wroc49i_xTMA2E1fvo.E36psjgn 9gK8UMLUyufRo6krXgkCq5i.zBGPJdSPS7C2lDjE3uh9CRKC7N8enCFtouvtSbOTgc.LWdM8v.mf 5K6GYqI2ETd5RnPsSH60- X-Sonic-MF: 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 To: Lars Ingebrigtsen 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> Date: Sun, 19 Sep 2021 08:33:37 +0800 In-Reply-To: <87y27uro4c.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 18 Sep 2021 15:48:19 +0200") Message-ID: <877dfdz9ni.fsf@yahoo.com> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 18 20:50:19 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 00:50:19 +0000 Received: from localhost ([127.0.0.1]:37210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRl2B-0002ff-6O for submit@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 ) id 1mRl29-0002fN-1f for 50660@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/rel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2hjnlYg1J6nHquuBWpw1o7DswWaY90lZ6NxnXWtFw39gzELvU99cX2BpsaM A7DO3zipGAb5YRdaT7pJd3kg1SnH1Bo_2xB9GR4awiVQ04vxkFS_iunJ1Ok6uw5.gQJQp1pES6Wr A.5r4cni0UGDTsMbBbeTPbBYN677NjAqgnJj6914oAzCIPDS_EQkc49bitEZoO3dFxisIH9Xm7Bv e8tmeNTEA5_4dUdVFBJoalsWcwsiUqm89r7K.cS8G3wjWXUSmocK51GxRrCICbosR4mLAvGWHr82 jj9KjSUJoJSEnW4Q.ImaNbZy9LRwzXSQ5vjAMGyNWJcSWvEw36fiKKLHtwKY4sTwbspJo.zp0TGs 7kl6AldAK2ifeFnYhCVosAfm4t97VyGVohotkRMzYtwBpsc5Kb65qQBVWdupJQ9m1vb4y_kICm7m ItrT0tZzCibhtB9MnnugwtTL0tCGgdy6hxX6pVkdYF8PM5PSqSAitKHYQLQCg6OHU7tzQA7LZPkE ZMohivGuBM34xiI6COdCilw7a9uEulIApq9Qlvlff2L5NEa91ge.RrErhCVUtxa7pL3Q- X-Sonic-MF: 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 To: Lars Ingebrigtsen 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> Date: Sun, 19 Sep 2021 08:50:03 +0800 In-Reply-To: <87y27uro4c.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 18 Sep 2021 15:48:19 +0200") Message-ID: <871r5lz8w4.fsf@yahoo.com> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 01:48:15 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 05:48:15 +0000 Received: from localhost ([127.0.0.1]:37340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRpgV-0001Vm-2j for submit@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 ) id 1mRpgS-0001VU-1R for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <877dfdz9ni.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <877dfdz9ni.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 50660@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" > > Lars Ingebrigtsen 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 09:55:28 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 13:55:28 +0000 Received: from localhost ([127.0.0.1]:38620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRxHz-0000Dx-PO for submit@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 ) id 1mRxHu-0008TR-Fi for 50660@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=D0MEeDOVfzhUxgqq454z0M933TtaR7gzm3iC3zYMMYE0QC4c9HdfFDuBOPGhYe9KDG34BFAawefpdUp46Gi2mX780wLXgkWGNgvudXhJyFsIKA4zZ0CZVSe9HzDB44Av8mzzh5fOirHj3Wb79SnXgBMa9Qj1wBIOLo0bKWu9sZmpuNF9SRP2Mh9D0s49e4XxUJESjUtkOB1z8RU2luY/zSp7FlDHNPaC4x/Wmy7dY+LSBrNnfiDEz/cGFRRXDjSv63MxVePN9yyZ0xSrUEddbXaK0gR1rVBCA0BSQZDExkLP3bUh7pPvuz850FGYtjpipLozG1XfdY9gYuwo7LrrSQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632059717; bh=3YUnFhS11y32pHAtTEXbHf7H2BFogJ9yxmLE9s0sMlc=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=SxyNiQwvcye/Eithb3X4DNX+jaavDXvqJFWseyTDuGULPyGK16yA41auq96XLhmil4GlmKHjpVmzWvqwXGSuyamtRZXpZNJR6nG5htX9HoFUtTvGxfIt+4SQ8GUT3JNbhvBHVjs7IcSS+dKoi/BPFcYHOprXp3+MyVK5NpTMcwVRFIgmJF3jT3lNfBI9ZuqKaTdiiNfcr4uIrPnGdsODuYTAJrmdtSNo2M1Y+bwgZfC3KMfMl742tPLm2NDwBnDtRJs6BEnhCUfahyFY5SYzoVMRuZZVcXcEldglI5w0uK2uhMbUwQsvGr6vRdPesBwX6jcaTtp3abAYL3SafDanEw== X-YMail-OSG: ZtRjK_YVM1lIcycR3UZtH5wjLLoHtXhxmcTEZKxkx1NjooV2NarbelJhulE8UYo oJRkFXmgv7fNHZuKrDGTIBIK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Q8slOolFwqTbTc6bzQyx78o9gYLhNWyTaD lV2xXMWTvIiOsgezSxRJwCMsR5KOszhs3B5s0Wu6IMgUdxTyungfh2ThZPGB.UC0g0Swr4W0TybU .reyIKzh.3AhiOK3rRwc- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> Date: Sun, 19 Sep 2021 21:55:07 +0800 In-Reply-To: <831r5l5d6d.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 Sep 2021 08:47:54 +0300") Message-ID: <87h7egy8jo.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 11:10:52 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 15:10:52 +0000 Received: from localhost ([127.0.0.1]:39523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRySy-0004VE-LN for submit@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 ) id 1mRySu-0004Ut-5X for 50660@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 ) id 1mRySk-0000XC-KV; Sun, 19 Sep 2021 17:10:42 +0200 From: Lars Ingebrigtsen To: Po Lu 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <871r5lz8w4.fsf@yahoo.com> Date: Sun, 19 Sep 2021 17:10:38 +0200 In-Reply-To: <871r5lz8w4.fsf@yahoo.com> (Po Lu's message of "Sun, 19 Sep 2021 08:50:03 +0800") Message-ID: <87bl4oob2p.fsf@gnus.org> 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 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Po Lu 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 11:13:58 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 15:13:58 +0000 Received: from localhost ([127.0.0.1]:39530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRyVy-0004a8-32 for submit@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 ) id 1mRyVv-0004Zs-D9 for 50660@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 ) id 1mRyVm-0000eg-Hy; Sun, 19 Sep 2021 17:13:49 +0200 From: Lars Ingebrigtsen To: Po Lu 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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> Date: Sun, 19 Sep 2021 17:13:46 +0200 In-Reply-To: <87h7egy8jo.fsf@yahoo.com> (Po Lu's message of "Sun, 19 Sep 2021 21:55:07 +0800") Message-ID: <877dfcoaxh.fsf@gnus.org> 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 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 , 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Po Lu 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 13:01:31 2021 Received: (at 50660) by debbugs.gnu.org; 19 Sep 2021 17:01:31 +0000 Received: from localhost ([127.0.0.1]:39775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mS0C3-0007jq-2H for submit@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 ) id 1mS0C0-0007jb-1g for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87h7egy8jo.fsf@yahoo.com> (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@yahoo.com> <87czp6ysw7.fsf@yahoo.com> <87y27uro4c.fsf@gnus.org> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 19 21:01:16 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 01:01:16 +0000 Received: from localhost ([127.0.0.1]:40341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mS7gK-00010N-8E for submit@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 ) id 1mS7gG-000108-TO for 50660@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/nVHgPfRNTK2EELjY4Bgl5IGtV2RspJusDAgih0bGJCvYmzf2Ap6Tvu5q3jfp6MhUmm9tY5Nw6nSh7yU60SXxd/wXnAaTKvZzPndEhz9VMzdKpzfaZWSn/WH0x9e2OuVCPPNlYsuw1J61BOva/3Tfhf2K8GMQKYdgXgwUXUndZGJcrq2BYAOjVQP7EuYYHvQP3yr0jfXcCZP8yQsk8zDWSes73Q9UfnmFAGo0lGHtDBBiuwsPhh8wMkIBpAKI2VvBSEJPvSG5M1uD4/xH0TZC3zkQ+Jdcqm7pf3JpuelKmjA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1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xiPsq0W6UDp8Vdsi79dLf7iox9O47z2roSfBZzTi3 kwCiRx9vXsh6VFIjPHhtzQ5lW1BAhd4niBXZittyooFiEFt62ItI9OgScoYsrDOUbfTqSQ2f8Ahj CrsbEUXuiDkXPEcKMC3sPRlcr1GP36CbTYwxXJuVBncr6LDHpWDwbiuBoxSqSN1EGmk3QY7ag2rf cgTRNRiLRYNh5u1G3iudDQY0SS_6NIkAFrAi27TumEb4rwt9ZRnf9czt4b3tvH.59qVURFQGx8cD 3MXgiSM._b55JLEPDMc_r2osow2dbLtgGHUOp66bXQpm9S34ahftMd2m5QQlHaeu1lyK.Mz0yuND a9.TAO.JSK0pwouNDzFWYjarVQuKGC3BGrP4UUZlaBLO8A6EvjGmWeVJatG.l6Cq2BqIyhm290cw LwcBOiUgaheZYE07.cF2cMLnU2LI87WyVIo0JC0g1F87WtSBGBTC8fS66V5uInAA2WebX4XF8QW0 4a2jJo1Uy_T0Wv6aZkm9S9Vrllz20smR8vIkCoL6bEKKsi6cJXXPhfgh8YAS61xD8wLJhR.nLhyD VHXFz3xHYqe8pGm1B6rX2EPjEeA3jfZ33w1qEr9aVyb5D1OExsO4DK85DHlcHon0T1SiKeVXe5CT 9BiZ6MSb9125n_mVjfw-- X-Sonic-MF: 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 To: Eli Zaretskii 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@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> Date: Mon, 20 Sep 2021 09:00:57 +0800 In-Reply-To: <838rzs4i09.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 Sep 2021 20:01:10 +0300") Message-ID: <87fsu06oxi.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 01:19:36 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 05:19:36 +0000 Received: from localhost ([127.0.0.1]:40567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSBiK-0007T0-3u for submit@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 ) id 1mSBiG-0007Sj-Fd for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87fsu06oxi.fsf@yahoo.com> (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@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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Mon, 20 Sep 2021 09:00:57 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 01:35:00 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 05:35:00 +0000 Received: from localhost ([127.0.0.1]:40626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSBxE-0007zU-DQ for submit@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 ) id 1mSBxC-0007zG-Ca for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <83ee9j3ju3.fsf@gnu.org> (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@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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 20 Sep 2021 08:19:16 +0300 > From: Eli Zaretskii > Cc: larsi@gnus.org, 50660@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". From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 02:33:22 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 06:33:22 +0000 Received: from localhost ([127.0.0.1]:40798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSCri-0001Qi-3n for submit@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 ) id 1mSCrf-0001QV-9j for 50660@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/vnjbNU/tR8k5ZQHuoGjw028LDYsMzb3Q4lbFbIA9oP1TPkmUbjZIXmlj9n0ujhj6uYuSSbmCUco4u7tVjRdTiptsYQwfI+HIIpR7cAkmiYm2VyfNFOJ16cBy9mPOwlCTwA2Kdm3YV+j5iTM9QJPeSl1WnyU1wwax7OfWmRkH8M/xr/wGhhPs33aA9irIlR0TESYI63nePx3/tpnrXXorOCn1BWxCaOCiCeQgZck5jPoaWBHZItrsSetEcIUA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632119593; bh=7m5IVC+B5h5ureyp6E8b+D7B/1Lazsi99foe/NaQ7Bu=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qVz1og5jRxEssJftzJXUALApAYi9+p0u0csL5HFIhQbC/0dSq6wUqr4Ap0IWtlB78STzgrHUkLD0IuyZQbjua7emrS1avU3fxGHvokYjOoNyLDbkMXc1YnBDKpFJp8dMKyTXuCtzZOuV6M34CKUyLmNQNzDBpfYAB9f8t0Kro9lHCuTrlDDFgjVikuhrblfEWKDteCibjEe8VuHuLcITW8Hs4UdEuPbhaJBc72tK2i6y3EWzAYfdFGXS0TQJLGgVg2EYZxbGgB2E8RXskHpM8rEMZGwpmD6RRAE1bFy4n5vkg3YkmjdwgSOIKvjsr0/sDqr6e87rxfP83e2x3yDjnA== X-YMail-OSG: v37l4X8VM1n5GuosQrChDIMto8Mt0ftYj04OLwxPeknLDReLAJbVIg_7xpQqlxc 4brhSuoNCGwjiAJ4G91QihDfx0lZthf2rG66ufz5pPJ5dSE2IJ_G5pLoLMuzbYCDRiPBBUA._5Vq TauAmJyUA95pVOHSEFPg8SfmtdHOFphw2LDTE52SUXyn2Xi2txFGnuPR65yJA3PLMKc5TMZHR0h3 92RB0Qwk_6qaDWFxsk2QV4MpT3mWMHI8H4wd8.s.CpGgOePC_gRmUFJsQR25UM4IOJfT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TTP; 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 To: Eli Zaretskii 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@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> Date: Mon, 20 Sep 2021 14:33:01 +0800 In-Reply-To: <87fsu06oxi.fsf@yahoo.com> (Po Lu's message of "Mon, 20 Sep 2021 09:00:57 +0800") Message-ID: <87v92v69k2.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 03:07:43 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 07:07:43 +0000 Received: from localhost ([127.0.0.1]:40827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSDOw-0002JK-Ot for submit@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 ) id 1mSDOu-0002J4-Rt for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <83ee9j3ju3.fsf@gnu.org> (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@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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 20 Sep 2021 08:19:16 +0300 > From: Eli Zaretskii > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 03:34:22 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 07:34:22 +0000 Received: from localhost ([127.0.0.1]:40900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSDoj-0007NR-Ni for submit@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 ) id 1mSDog-0007N8-8I for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <834kaf3ets.fsf@gnu.org> (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@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> <834kaf3ets.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 20 Sep 2021 10:07:27 +0300 > From: Eli Zaretskii > Cc: larsi@gnus.org, 50660@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? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 04:02:22 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:02:22 +0000 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 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+e4WbM20e2vLpMHXtOiVC1qlZdajtTz8DePpt4HgyB5i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FXUcF.v6.ChXUX5PnufqdzLj8Wq Y2oF6I47eF7ybOlSmXCcRLY3sjjVQRunLqV811lJ85zRxTHVzPhwmPzdA4ICroWFxWJhbzpkSASJ mfKblchl3fWnR31mst2nq2PpS9dyCAu29qxuWX604aOx7yHYq2aRbWMWr_hLYmANo_KOfpDacLe_ KTl.s552x2JhF5ymyJx0X8gJdDI.pgHC.dAabxmLFu.ZlItBpzn6p18m2dfsLB1ppYZGLafYlsbi TRr_72QC6sgEDHO8_YhwdWXaVrKV_kNPP47hxm89Z0gi6Q480Woes3XqpVcqnDDyT_TXS5jrJNAy c5jTOOUsMX1Tv_VWdj17h7eKQDfaPVAyXx6sh09Pum62P9LoZCVgk0uZtiSLO_DGBYu.uVyn4y47 hZhvSUaMcRf9aQiaq X-Sonic-MF: 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 To: Eli Zaretskii 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@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> Date: Mon, 20 Sep 2021 16:02:02 +0800 In-Reply-To: <83ee9j3ju3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 08:19:16 +0300") Message-ID: <87a6k765fp.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 04:02:57 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:02:57 +0000 Received: from localhost ([127.0.0.1]:40928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSEGP-00085f-8T for submit@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 ) id 1mSEGN-00085T-Qp for 50660@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/Lbqj6BdzIuTqjF8kvYLxORZPk7fCqYsNxB3xaIed4qCXbqW4G3As9Nl6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tUMYcZqM6IVFvPHttn2QLBId0i1AjWYciMGRWhxaUcA4pkvJpKC3wjQwRqOeBU1_wZcdVJ l5SKoCidThUIa2WpH91n2eeLbNDtv.eWcj3Rf_tkMsS0N5F_0QngKTCuT6fHGqUYXwERvkZtCGia WKg1IISmm_sJ5NvwcoFPtLzNuX0EZ1UEWiyR3YDPr3S016biDzsJnZ.znF.7Ys8RrmdV3f8bPUlz 78wavKH77PIBZOrzHrDsXAn46hPjp_kZekxoTgO4tZHBGJ76QiKyJ3018hU_CiRDHB0ojYX8Q3tq zsQm7YXyYR.khqd844oyUQYmUQc932uzGaTgegPskZFyqXz51E.B1eH8j7.tFahkoALJFiHXmOlT xaYL6tOnmxPnsg9JzcJi7_341d1ie_dtizghzdKpFVJZKN731BP1RwSbh4MstL2lrhukwSlPbgVt 2cXzlGnTwsMiDvbDzEA-- X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <83czp33j4d.fsf@gnu.org> Date: Mon, 20 Sep 2021 16:02:40 +0800 In-Reply-To: <83czp33j4d.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 08:34:42 +0300") Message-ID: <875yuv65en.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 04:18:17 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 08:18:17 +0000 Received: from localhost ([127.0.0.1]:40947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSEVF-0008Rn-Jm for submit@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 ) id 1mSEVE-0008Ra-7q for 50660@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+Yit6lWofRJsQ0Z78TQihunrGuncN98JppRkTt8tMSENxjoH5qKWK0opXePG2GiM4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xcIi2WiZpNGQnySQjERf0uMLD5ib9ZeXn XU77PSWyAG73jykWHRzPzDN1NOl0dISkVPYn1.hP6EmorWTvzAYt3rcZ3QDylDXp.FExnO9RRutF SwcTcJ0XEBt274UpfWh.u6Qgc24Cr9yK4C7UyBTNe5iv3e0hgcw_FZqC8886drqPcPTRdDVOP.1E hQRqOiHKBqMI.B3Eu4rVteorl679TdnSP7oNrO4CTxF3D_86ucCYgIMuYFzlTS57oB_6Njsjgp_4 L062ap6v2YDHce9.PXpb9QH05oamvs.l49ngKdZsmZNbS14Pe9SQVV5rjRzqb0xH7WQSEp.lD.YE k49hwSicrjL2niaS0JO4MstISXxEoaZrR3zgV2oFS.G2M7n9iO04fUJ3wjK_pQUQSk60vdnLgcLY 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: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> Date: Mon, 20 Sep 2021 16:18:01 +0800 In-Reply-To: <8335pz3dli.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 10:34:01 +0300") Message-ID: <87r1dj4q4m.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 05:48:03 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 09:48:03 +0000 Received: from localhost ([127.0.0.1]:41016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSFu6-0004NP-PA for submit@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 ) id 1mSFu4-0004Mv-D4 for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87r1dj4q4m.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Mon, 20 Sep 2021 16:18:01 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 06:27:19 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 10:27:19 +0000 Received: from localhost ([127.0.0.1]:41038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSGW7-0005RQ-5I for submit@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 ) id 1mSGW4-0005RA-98 for 50660@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+esVzlinaFixNfn3uK0SFNCgZyFJyYjpeyROenOicxXyRUejRY7JYR0H0w1CnpfOPQzrGd2pIB3R+qpW2L9ABrpTe/DMJmWKNFcu9fusCCznAtEtkraA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632133630; bh=9Qq/1CYd1BaBJj4sl/CFpY0mvNYlW0fGN7IfLasrfQn=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=OrnbWC9qzPb/+CYNAgKdqp1PdTup5eIl6lQywlhnCnNU0IDWNkqgx/LUPnqwpZ+Kp+eP56R+53+ozOFpFRhxmmd0Nrc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ilJ_TbiQ.4K4NAQxgulHXTCThNuNjGNYjpZWB2f._swo4.fP0n_TRf740sgJlRRWmYjgDAYhGH 28AKY6XWKjjBvE7hPNgfnk04qnzR21A4ZAxWSwstxSwpOSIzB6obPf3XxB22qI.IFTb5Kys3xoRX EgCcbqfayu_sGWLvgFM4brYoOeQHpIFGXaS1zrrSNAdPZOW8n3DWU8hdh4tUfShW5nfR6Kvljtf5 Hvow5Y6ZsEKPhLVq5F9StZmK6zcQL0dNPSLbWy1Exc0geQVzuCIFaX5NG23YyRFGX_87I.x1wNng 6gXgU6j6zPbBIqbAIC.OAbKAdNz6UIGPPUkaEXkuzXEe5VemyuObDXxirV99NyC0LewqmVJrP6Qo CcCeq6k_PtMrzcx.wIPpCVhdwXx_O6ZcreIN69p_IM6xBWHJtaZkarMCbg3LKZJxLDpSEAaAtydu jP0supI7wpd2YF2cO X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> Date: Mon, 20 Sep 2021 18:27:02 +0800 In-Reply-To: <83zgs71su7.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 12:47:44 +0300") Message-ID: <87k0jb4k5l.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 06:51:45 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 10:51:45 +0000 Received: from localhost ([127.0.0.1]:41072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSGtl-0008Cl-Gk for submit@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 ) id 1mSGtj-0008CX-14 for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87k0jb4k5l.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Mon, 20 Sep 2021 18:27:02 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 07:08:28 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 11:08:28 +0000 Received: from localhost ([127.0.0.1]:41086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSH9w-0000CA-Aw for submit@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 ) id 1mSH9u-0000By-Mf for 50660@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=AIGmjpawR14uA37WyhO9pqjO7U4iWcS2nH79wZvsAEd1jAh7t4mZJ2I9oAlih/UkpJm8cWqRERa2PHfTJXNwVatinN1qk7LgaRYsk3UHpR+rHfFhftS3dah+Eh8bwHN1wR3J4DrPK3Ni5jbEQWkigL/IPUIRz44JOQUgZPqaJjl8Tp42EjJS6ilUA6aztd0uvh140c2Mhp38LLu68mo0RrdP9xNBKn6VT7usTLXNuRgeT4u0JEBjz8zYsG7goVAsY359HQozaOL33G0hx1B2H0rGKwCCpLfL8WT70CimnmbPGSe7sIUkotQDGk0fGZVyGYjQ5SfxGmuH65tuURs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jJtiW5yRO0FSf491ij RH441Dls5TIublVmnuQA739jPE.jLAQPek8hT2PGYvJeBqLoXy7w5J5pVbGnIt.pPE8yBRz83gYQ _nVINizVOgPnvszaQ_Vfhk7UU4OqiiZUdFaBJE8Oeofmbtoc5KHeFkbNDAZebuqFZmYYxQ_WOTjv E9i9G.s2xb.KKsp3W1Ni0wskGk91LWUOwhRqZOlI32UcGtX_ze1JJNtYV.vYS2jOabiLSa.N_O5a o_JM8gu9hmQkcSVp0KXvSTgkHdSHLnVN7C_hE5mzHxkwdWauP8TLAVFFggzuk2X_U6OiX45yBAtW 2Z7TIy4Ktlacpo91IzsEoKT6wGSCFaWM4N4honkztRAyZayRHPvkhOhbBAxJ.EkDHSXrEcQ82_DF aT.mL30LGR42GCFeTvFU6eGTSPOP1mNbitLHSfyHciXKbVu7abHU7Pqxv0yRkWHkZVltudVk0kjP WVftUB1uEt9ywB5dr072JqG.driqyx1pPYoU9nnHbGnNCetK.kl8L9OpDIUI6uoYDakLX1_bfN2a r6bYkcoZ.BxYmY62N6jBmY2BBUqE7bYQbgpTLmDyx_LtdoP51RGyngKCe3g.aBMr2BzsCpMgfd0w rBLuUlsJNsO.wzcSVqE1OifQhuD8SVf9Md_KG_.WXA23iYjUUU22dXW97Z3jDTPy8idrVhe.kgtD NqLgoNAaaXwWGIL_IvV8- X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> Date: Mon, 20 Sep 2021 19:08:13 +0800 In-Reply-To: <83sfxz1pw0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 13:51:27 +0300") Message-ID: <87ee9j4i8y.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii 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; --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 07:09:36 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 11:09:37 +0000 Received: from localhost ([127.0.0.1]:41091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSHB2-0000E6-Ov for submit@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 ) id 1mSHB0-0000Dm-V8 for 50660@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/8rHQbgSwcnOLMtvbKesTaBEUAw8NqQczszkHUXoBsKRS0Z/z/PP6qmAQHA4OUNHrCs7aiVOUfIFUfnN/EChfZvl06ZoQh2dY6Lnu4absXiYtib/WzhSJEt52SSwDJNQTMwxPpK9vlXfBSuOhqUYYMa3UmAoHQ9TWHQaNyCFVsnG6Pe6bTTn1g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632136169; bh=U8gAFlHHjDELrJOEi9xw7iHQKgSDJQDbWR8o3GVRZIT=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=avhbLSEqrJyTFSOshUR/5GnkeP7cN9VCDQMcadyQtDYwE582X4wv2RDV3ImtSF7BW0Xr3HOI3RSKRB/LcqU7keh/+whNkRvnEPRAiZrKMxfKxz4UxY93fms4060OGILvuo2jioctBOdisOCNbC2/MvTLPq67F/EJao8ZcMWKfW4ivmU/oi8PDPOpBSw/I7ZOVouEWI9t4BDprEz89CPC6/Q0efKawjHzToMEpd8qRSeL1A+8uRm+vtb6azZgmc9Uwpb24HpHn2hShhrFtkcOuun8h1KTJ+we3DmonJCPvDLDv8Y2CUYCQE6usvQjtacIc/o+sdts4a2SiFOYs10UjA== X-YMail-OSG: OxdM5EcVM1kMNiyFFOFWVVxb1BwiRgfKjTXp6E6iEl3XACAqNFyuofi1hieWvwM WXlAOA6Iaio9YodolowKrLm.6TwAR4ZSitWYrbv_RaEcSEJAqR1vFY3kiuDgQeLKqwFMIs7rH9v8 VmTbeFxSOwBXFve7cQFWvcEWs8Zh9s9B7xlXDwLsXiivNOjq9rc6HvTmiqvel7tDSVXPJcu.AnnV sWiAXn3y1ld.iM2eNbc4y77SwCx6C9fvc_q8ueV3GU03DOFovQVoWpLJULcxkPgYSEScc0OuwbeV X1aXFxNI6zNpJJS.GyFKHIQVEQPez_VPLPZ4ic4jkaIpvxGx0jHF.UvOAzQWrohPktXQujis7E_Y i5bFA.rvwqDTRpXMGnTYwFfQbRxgf4mThXKmgmNniFL7N.hoSjha3AWftG5VYtnHvOKAy0Ek9hol UnZCbtzOxVW7EqRNYq6MrRj6f8Pegn2pxB6Rbg7R9L5FXNt6ThuZ04OW48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Qk2bf 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: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> Date: Mon, 20 Sep 2021 19:09:20 +0800 In-Reply-To: <83sfxz1pw0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 13:51:27 +0300") Message-ID: <87a6k74i73.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 08:08:02 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 12:08:02 +0000 Received: from localhost ([127.0.0.1]:41148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSI5a-0005yi-9X for submit@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 ) id 1mSI5Y-0005yJ-1I for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87ee9j4i8y.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 08:36:29 2021 Received: (at 50660) by debbugs.gnu.org; 20 Sep 2021 12:36:29 +0000 Received: from localhost ([127.0.0.1]:41190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSIX7-0006fm-74 for submit@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 ) id 1mSIX5-0006fZ-PY for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87ee9j4i8y.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 20 20:38:46 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 00:38:46 +0000 Received: from localhost ([127.0.0.1]:44337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSTo5-00050S-PM for submit@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 ) id 1mSTo3-000509-Oj for 50660@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:Sub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ub4PBPC17T5VrtNAN wnrtf2ENM0JXaUpgPcvMnmXSF6AG4XFqIvVyCfE1yzchxso.wURar3KGeffe34dPF58jZcreS_nj GabRD9ghyYPTu91x5e_raP6CoKRX3czWXsTqsstX533cV059N61U9K8iy.kCSpPBnXiDaxgc1NuG 4oJjjQPiaLq8v72Z_zMnQsYC2d53D8AyhAtqXgDA28pGIydW.ZUaqu1kUu66ZByjuJgiZsLmQ5FM UAgsnIGfiEdTx3Nxj.B2ueSkCCOSnmfgik1GPDuSxM.I4OBzIcH6iY5XB3lYXPthDyrgi.eKILF_ f9bXUJ00UHsVDVPaPOFPuflwxi.66q8X8aH.GLc5eoDVGDp2PqXORR7qXqlx7l51LYxGkgEErvaI i4_Y697MIHAb91MX1IsUpXh.Iqxs_mua61UIa1BBgLvVzP1iv71TIGUEftLPnGUM3UI_F0K5KOh_ 0g54H.Jj3_nEY7ewf2H2Rj4HieDbzQyQ.xKYmoK1qL6sK70isM_PZVxieUmfINFdGQCK.xzdda9q hxvT7lXr.gj6n_RiehHsEhA-- X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> Date: Tue, 21 Sep 2021 08:38:31 +0800 In-Reply-To: <83o88n1l1f.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 15:36:12 +0300") Message-ID: <87pmt23gqg.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 02:11:58 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 06:11:59 +0000 Received: from localhost ([127.0.0.1]:44684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSZ0Y-0002vk-Na for submit@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 ) id 1mSZ0X-0002vW-3m for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87pmt23gqg.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Tue, 21 Sep 2021 08:38:31 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 03:35:08 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 07:35:08 +0000 Received: from localhost ([127.0.0.1]:44744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSaJ1-0005Gs-Qh for submit@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 ) id 1mSaIv-0005GB-PV for 50660@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+ii9eDnI6LXy49OpMMh1bhtgYxS8TlCA3x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JvdBKE9DaBR17Rjsh5j6h33445wXGanRtsXjasf5YJ_pd 45sB4JCho2j.CW_cl.9BtrT1.B_y.dsZeUWUx_lPhG7iQfOMb1yblpucpk5gMNkqpBewVwWUEXSO HzvOTnVNiU5DCadxPqAeFDGWOvena5R8HHz9coAg0Qtsib2_0dJPUi4IoVH5uh8nNGetIExkDCW0 85odmnu9BxysQIX826HTxr0yAqDshXVH.9GG3lg_.xlt1oEk48fseFKDXsALsNX.XvDHg4zdXFnq xSZwI1cHvH3MreijzjtFzPfJTCmrT4DbwutNTTi4wRoBJdMtpBor14SM.yFeJrVhl2Z3nPcGdljB lD1kG5WYqW5FzjCLEm5q1av2sSdPWi6Ea3dTa0AuBm1oMm_3QmfhREhTAksFZmy.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: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> Date: Tue, 21 Sep 2021 15:34:48 +0800 In-Reply-To: <8335py1mqm.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep 2021 09:11:45 +0300") Message-ID: <87a6k62xgn.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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! From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 04:45:48 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 08:45:48 +0000 Received: from localhost ([127.0.0.1]:44862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSbPQ-000128-8c for submit@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 ) id 1mSbPO-00011u-RS for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87a6k62xgn.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Tue, 21 Sep 2021 15:34:48 +0800 > > Eli Zaretskii 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? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 05:20:48 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:20:48 +0000 Received: from localhost ([127.0.0.1]:44898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSbxI-00022m-E7 for submit@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 ) id 1mSbxG-00022W-Rs for 50660@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/IlJQlG78qst6KiFtRPIjHZUItoQpUvYpNO3zCLUdkK6AXfAdIZmfHf1k6t/2L4Ny8mC8X7cGwvNfocy6VfLeZV5uKfO9/COuWOF0MW4gcudaJHXK9DBEXBryewtYySxpRGv+RAPIa/HudyVWbN+WVPBt9dQa4vDUniC6TSnylhlghFxH0j4g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1632216040; bh=z/iqGrjpIf2rKn4HLzW1K0of9c2gKZkl+TBVgzwSXfq=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=XfUvHvVoE9obnzmWYk3WlLr4hrWrNQZTRpnBIJIAxNPEYCA0FA0rl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EaLsgeywFRkrO6n66IxHTOQcBf bdE0KmaWqZ9z5Cgqto7RppJYRonUiIhjqBb4XlI44Gy.ozGm7.KVoKXvlJ1zG5Y7waDk0AuqQigj 41BZAgJS9nHh5uzF8K42AJKC1INBIVBoumbEE8Kw3b6F35iZjsXbLg_7JG9HWju9G6vQLj5mp5ev uLuppvbFmwwvKVMoJR2lMH8Ibqt5mmdI640ML.miBn.YM45vSwQNQjEoxFNUjyB8z_gQtr8N7xLn Up7wmWgzkKmUqNT72SSPWyCuAJeSDOu7po8fz0QAHk4iHdg1tbJFr08WBH3AkhZMjSvXScsRPdEk 7cLtRt03XKIvaOU19KuzbBUblEOyWhNAs04m53.hO2iYwaFInbrHZ5GjUHG0Fn6mZ.OW.ZdqS8ei 0xLC.SRjs_qjCtm6ZhTeIge1qHbmieteB.2FZ76ExaohWjGZ2l2wthTdui2nGfwy.vbuzI4M4y4G TQOT0gXd6KQ0fFyS5 X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> Date: Tue, 21 Sep 2021 17:20:31 +0800 In-Reply-To: <83pmt2z593.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep 2021 11:45:28 +0300") Message-ID: <874kae2skg.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 05:38:12 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:38:12 +0000 Received: from localhost ([127.0.0.1]:44951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mScE8-0002bp-25 for submit@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 ) id 1mScE6-0002be-TM for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <874kae2skg.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 05:45:54 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 09:45:54 +0000 Received: from localhost ([127.0.0.1]:44969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mScLa-0002qF-Hv for submit@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 ) id 1mScLZ-0002q2-Dj for 50660@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/tiubOBQtiGih3jsetsubTj6Edky2rFS2LMOshJr1usaggny8q8rF5WPy3rQ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zqpn7tGWo8h21V2gw10Q0LFUsjJ9SL35A24yV5oq5TDJhjtWL8HW6zeZzp4Grly6 JTFcq8GyFu6KsFrVzs0PcKeA1_UfqHZljxMFTi9TGQ8wV1PvWgxA2VlkIq4vjnOipmjdLMgn50RV VOhmBi.E6h8112egKUj8X1jou.g6i_CkaHCNK50gEtMMwozocSazkVhWuL.tptS4DLg.De8EI7wb Ye70S5yyw6U_KN3oAz_Uize_L7cbqCCVvZJkchzZe3sqvKVOh5zFVDiSLGynlGVEKU1EsiHwNcvb 7ihXjpOPfq7EVb.h6wbB_s6DmbOWMhbIAyP7hW3psTem4GiwyUeVLpXKKzX_haxLh4SKdFLBWCOu _ldzlOFWb_z1NwlLOrgzuBArdC3vg_KZ4i7LBVkVJefcqzYc6mPySKr6.LcQeNkfoamGV.CvGS.D _CbAZJKrDWOC70.npepmiLJMoeDAH1hVjhii960XG17KGw9SEjpnDmRTlXAxeKWPT1RDyICU.6mF jP9bUAkYUJvakxhbFtUkJkTud.wc3JQ.D2vn6yVCYDrlVkUNaSOrYOnI.dv__CTYQhZWuWXZfI7B 2yVwQIGFd8kqKNjkaIs5t2v6tCNJPWSPjeNccYGQlsJzI4oRwm_gW3FXXPnKiJDPRU34XEyqOFSM kESRr.rY18JA1Nw4_5eGxzPpssu2zSjVkLFkixBm43OwWoqrtmbvB_KTga5Oig6vxesBmftqZx9z 5r.vADXUvq57BxKnVXphssF.KjqJ8U.x.6iz5KNR__KoyimwgpaC6U91T6tQvp7fREKCYPom04qt A2_uIcDlhw_uCrCRKiK9kWXbmL91Rtfvd1Poe45Px08daJidT81.jgX0PHH7Jbb1_orWyzgEgZl8 v6g39OCF9NfKp5vC5cg-- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> <83ee9iz2tm.fsf@gnu.org> Date: Tue, 21 Sep 2021 17:45:37 +0800 In-Reply-To: <83ee9iz2tm.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep 2021 12:37:57 +0300") Message-ID: <87wnna1cu6.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 06:18:14 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 10:18:14 +0000 Received: from localhost ([127.0.0.1]:45025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mScqs-000886-0i for submit@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 ) id 1mScqq-00087t-LU for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87wnna1cu6.fsf@yahoo.com> (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@yahoo.com> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> <83ee9iz2tm.fsf@gnu.org> <87wnna1cu6.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Tue, 21 Sep 2021 17:45:37 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 06:41:47 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 10:41:47 +0000 Received: from localhost ([127.0.0.1]:45051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSdDf-0000UT-J7 for submit@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 ) id 1mSdDa-0000UA-BT for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Eli Zaretskii In-Reply-To: <83bl4mz0yx.fsf@gnu.org> (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@yahoo.com> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> <83ee9iz2tm.fsf@gnu.org> <87wnna1cu6.fsf@yahoo.com> <83bl4mz0yx.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: luangruo@yahoo.com, larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 21 Sep 2021 13:17:58 +0300 > From: Eli Zaretskii > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > > > From: Po Lu > > Cc: larsi@gnus.org, 50660@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.) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 08:26:38 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 12:26:38 +0000 Received: from localhost ([127.0.0.1]:45169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSer7-0007lQ-VN for submit@debbugs.gnu.org; Tue, 21 Sep 2021 08:26:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSer6-0007lD-9m for 50660@debbugs.gnu.org; Tue, 21 Sep 2021 08:26:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47686) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSer0-00027V-Uy; Tue, 21 Sep 2021 08:26:30 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2256 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSeqw-0004Mp-CA; Tue, 21 Sep 2021 08:26:30 -0400 Date: Tue, 21 Sep 2021 15:26:19 +0300 Message-Id: <83y27qxggk.fsf@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <83a6k6yzvr.fsf@gnu.org> (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@yahoo.com> <877dfdz9ni.fsf@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87ee9j4i8y.fsf@yahoo.com> <83o88n1l1f.fsf@gnu.org> <87pmt23gqg.fsf@yahoo.com> <8335py1mqm.fsf@gnu.org> <87a6k62xgn.fsf@yahoo.com> <83pmt2z593.fsf@gnu.org> <874kae2skg.fsf@yahoo.com> <83ee9iz2tm.fsf@gnu.org> <87wnna1cu6.fsf@yahoo.com> <83bl4mz0yx.fsf@gnu.org> <83a6k6yzvr.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 21 Sep 2021 13:41:28 +0300 > From: Eli Zaretskii > Cc: luangruo@yahoo.com, larsi@gnus.org, 50660@debbugs.gnu.org > > Here's a specific idea: add the same code which fixes the cursor > position into gui_update_window_end, before display_and_set_cursor is > called, here: > > if (!w->pseudo_window_p) > { > block_input (); > > if (cursor_on_p) > display_and_set_cursor (w, true, > w->output_cursor.hpos, w->output_cursor.vpos, > w->output_cursor.x, w->output_cursor.y); > > if (draw_window_fringes (w, true)) > { > if (WINDOW_RIGHT_DIVIDER_WIDTH (w)) > gui_draw_right_divider (w); > else > gui_draw_vertical_border (w); > } > unblock_input (); > } > > This is always called when the display is updated, even if we just > move the cursor. By looking at the value of cursor_in_mouse_face_p, > we can determine whether the fix is needed, and apply it before > calling display_and_set_cursor. (We will need to fix w->phys_cursor.x > after the call to display_and_set_cursor returns, because it records > there the value passed as the 5th argument.) Actually, it looks like it would be enough to set mouse_face_overwritten_p = true in gui_update_window_end, when the cursor is inside mouse face highlighted text. Then, as the comments near the end of gui_update_window_end tell, this function already arranges for the mouse-highlight to be redisplayed, and that will call show_mouse_face. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 08:47:11 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 12:47:12 +0000 Received: from localhost ([127.0.0.1]:45214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSfB1-0001YG-MS for submit@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 ) id 1mSfB0-0001Tm-2Z for 50660@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/6YMJzuwGI6xrV7EZs8edKZRJYABZ3QYuOtDlnQBFag45CUE9WCJQX4o6mMWaMFJmA9v68BTKZ9L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FWnpI4 zUxkgQ9ljSO8zSSvL0k9RhYw7vuyRNb0TkbQMY0uPq6Ep.QXutXt6jj6lOu4Ha.niy3F5R8ppSL7 KzrSeHDzFNui0aIs0vhpHp9LtDio7l.4htmvNdu9CsCpoWkbUduqbeMoGit.SBfSISGd2lY4PBnC Eh4Scmc_OEei38fvTN4VG8jpG5R2NINYIsRYhyrh6wTF00PKYGFEGQIrAL7D3AkVyOL1aFCieH0f QPQJ1SNybEWSknN26MGRmDsNaXuy9ZHjsOy2ldMJgzUz2fQIFfdcV5IL1guU9HcxxsJLEItaMMT5 mJ1z8D3SE2ejCX3gP8YLgJFhIjZ93Hp4K0C6WacIycq8NeLdR0KYZiA7oQwNyKeyIDcSZMF7TduW B.6NfZ7Z9VLPocaIgnfK2LqmtKnllhDspBOF9WfQuq46SQpSNLgpMIeBwgjjnY9adLlBh5I7_rv8 9iGPAZE_vVv.lL93ysbmH X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> Date: Tue, 21 Sep 2021 20:46:55 +0800 In-Reply-To: <83sfxz1pw0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Sep 2021 13:51:27 +0300") Message-ID: <87o88m14g0.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 09:11:02 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:11:02 +0000 Received: from localhost ([127.0.0.1]:45369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSfY6-0002sJ-Dz for submit@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 ) id 1mSfY4-0002ro-RQ for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87o88m14g0.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 09:36:59 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:37:00 +0000 Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSfxD-0005jn-OC for submit@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 ) id 1mSfxC-0005jc-Fo for 50660@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+gWVViRaHYsSApUcZNpHJ9QrXOmQ1GUCUv8eYk=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=AUtDr7tQajtqLxVNEtAQYyLd+cx3dnrncsHxFRYdBYut82GNxEL74xJ6gm+w/ww42hH97R0/e4i5rJNl0ShIgM7LXSvOLh0BVU4E1QvlBNCosgIcW28e0U7YmRfJyV/Zyxxd50FzfyqZI6WSeHl+IDJAehDILeWcdNfp3kPxI6fMvmitTc0RYY1iDX7UtCSrZWohPuAfghpD4oyrRdkGHR3p6bufJXUz1dawLRpq/rybpqB/CJx1bPBoLquDqdozj9c0yg8uk666Ekqy8DGeUcDgrp65IKZIQrBjMWTIHVWXxx4AcYwoTOJ8ZWDR4RkUtZtLzxX+KYxzDoByYUs4XA== X-YMail-OSG: S6MHA24VM1klyS2HKmR3enz3ZApe7FFxub4Q6uV0GT6xKOaTpcIAet.yBxI8_6x oYB0gGNgUZTlr_VR_9jm.w6kPjVp9ao1qep_bppZZ6NL1E9Pwpn3YjofQkummFzJlOd8r.Tm02_h mpJKihgbob_EbcARDRv_ZvqqbkDk51tp70af1OdahguLRIbTwBX1hgykyO5Gr4Uhnlu.of0.dGde rQykmrruSYSki0rBOPjKvj6ShWhoH0mDJqMlA1h36.kbQbJK_6CrLL4fhJkJi.ZL0ZeuE2oQuy0t j0.XxPp0Z051c.aZpJ4r4mMArixK0LjtgnbldQ2YgaRLeQ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McXnE.FYXjl2Fjvg4bokqxjY wLhhqYIxfy77AmnC0OKjxxKzlwbyuooWpIzMdF254KfIzJmgWpmKv9t7RPp2tvHurl1OISIW0Hmg QVmLzLzQ2mnoVF1G4iMYLVI1s4cyL55dnSzStozqBXIymKU4vACyWWObE1vJWsaC_fmY15hxVVcn AuJSF2Zebw4LJ0MEvPgbQ8eTKaQR0nlSBJE0ZnOVDwDt3eElnN3pzn35_jDYG3XkL6iCl_QEv5sj 01qV1ddXcKs2O9JZru7gAE1WC3h8mSxmidkvKMw6MZ9kppHlqZa5pkWhvkuRcU59zyqHs0TRFVJf 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: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> Date: Tue, 21 Sep 2021 21:36:41 +0800 In-Reply-To: <83sfxyxeer.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep 2021 16:10:36 +0300") Message-ID: <87h7ee1252.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 09:47:56 2021 Received: (at 50660) by debbugs.gnu.org; 21 Sep 2021 13:47:57 +0000 Received: from localhost ([127.0.0.1]:45471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSg7o-00065k-NZ for submit@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 ) id 1mSg7n-00064y-4u for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87h7ee1252.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Tue, 21 Sep 2021 21:36:41 +0800 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 19:53:39 2021 Received: (at 50660) by debbugs.gnu.org; 23 Sep 2021 23:53:39 +0000 Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTYX5-0006jN-03 for submit@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 ) id 1mTYX3-0006j9-E3 for 50660@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/z5HFJjh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N Byf4_GxGaUqlqVu0eeq.2Cuqi_dgrjNzIEg5q0K9YS6ydOE8zcyFzsZa.QnE9CpA3JDnK2qAz7dR 6L53Uv1ReoigdpBtvtK7lAKN9dxqG_btLb0pOIOpMXA_703KxAD4ZbwBdYYJDeVJhu26O8hHgtQR tqcYsnDCu6J8rx7UPehtJ4rueBkop2CsYF9jDDj.XlUTLsc7o2ljhIKLWZReeSWNVLyRBlQQctwf 7LsOdDVFQZiopbdMqZC3yEgLLb_BCQZ6b0nyMqFHVjyzOheq4nvpcI7jLorAIdzaSQ6v2shFcZ8c L9IdmD.qdxReh2g-- X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> Date: Fri, 24 Sep 2021 07:53:20 +0800 In-Reply-To: <83pmt2xcox.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Sep 2021 16:47:42 +0300") Message-ID: <87lf3myhlb.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 24 02:47:17 2021 Received: (at 50660) by debbugs.gnu.org; 24 Sep 2021 06:47:17 +0000 Received: from localhost ([127.0.0.1]:56527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTezN-0001Jx-LS for submit@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 ) id 1mTezL-0001Jh-Fr for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87lf3myhlb.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 26 02:46:26 2021 Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 06:46:27 +0000 Received: from localhost ([127.0.0.1]:35583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUNve-0002JC-IF for submit@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 ) id 1mUNvd-0002DQ-0V for 50660@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+fEKfD52+McnI+GgMpG/XfhwGL0GiRAQJXIv3JyTKPHABVL3m+iS4rscjmutoCfFaxZ28EY+gGqhWdUp9ourHubIoN1lIOISOI2ssna21ZxQ3d18wToaBAo9wKIxa3l4vY+rb7NodLIfkZf0gKMMK1owY8X+aHvG+pznVc0DrPeyIx9UjmDtQRl3w4mMz5yPoRmjkbPVU9KufTUUQjf7cBk0J/i8zLZv4E7l9SJFcoctY2dv8bMxPvV3dYM3DgLN6ioUYVa19ijyKUVEzpKt9qT11DYKJ9ivluOkJlQ== X-YMail-OSG: yJzdxxwVM1k4jCGDsc8BCrV7c00cnt60UCFCX1GRnYXtJgqD8Qh_ecCxArwmDeY _TtiDIKIhdhCBIQyvV7um2hmQhgKvawPjRG31Grtj5fQq8ZlnIRKENm5gIo_CV8d29RvRB4RGbvZ DfezzXtkb.Bc16PHpvY7bo.WaMz.p2huDgMaAmThNLCOp1fUIUx52cmWmjnZb5jwe.u_L1QB605I Ij93jDSFU9G86hKtYFvvQbhRXgqOtWZs4TY1pecDZh.o9ZzOo8e6gJWjksiDnRcP.Y_UfxmefbEn Xi.MKvIStVP4.7n5pBGaZJvwq8hPFbDpYiwC5iMzTMmVkLht9gSjeRrtpmzA32cyf31cc_38iPH8 0gzHOsRh3f5ZxlESeNJ42atvHhQRZ42elGbxPr6LkMHoRZCizCLAvcGDPL89FWRTCR5Ggwhygh31 i_wqBVDTeosewpfxNtiU3SpBU.5naoXRo.rULper12jaIJ_b.1SIBJ9u3BWNJVkEhaswddcXs02Q sSWvZ61m7UB9IUOIbZPczmYeBoadR6FWtzoAuybCeZiWJ7vJZBOJ2xnU3cenr4jSKQOuh.L4k1Ja x92NB8e6tf2hS960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K.pPeD0H3ECuSQlrmquAOOP3HTOLKt6PvdDnhY7Dl.AxzHjTC53Vzm9om I9l7F6hpslM7mdG42dMQuuQlhmPeFIhkWvXh9uGhXy_dvUPsCQ31jxSPFafJjh1Ws_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: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> Date: Sun, 26 Sep 2021 14:46:09 +0800 In-Reply-To: <87lf3myhlb.fsf@yahoo.com> (Po Lu's message of "Fri, 24 Sep 2021 07:53:20 +0800") Message-ID: <87a6jzvnpq.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Po Lu 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 26 03:04:14 2021 Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 07:04:14 +0000 Received: from localhost ([127.0.0.1]:35614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUOCs-0005vg-0v for submit@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 ) id 1mUOCq-0005vU-EC for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87a6jzvnpq.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sun, 26 Sep 2021 14:46:09 +0800 > > Po Lu 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? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 26 05:56:16 2021 Received: (at 50660) by debbugs.gnu.org; 26 Sep 2021 09:56:17 +0000 Received: from localhost ([127.0.0.1]:35948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUQtM-0006WF-P8 for submit@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 ) id 1mUQtM-0006Vy-46 for 50660@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_jCf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ew3uDFzCwB8Xgih03rEHg71iQKVbXTKwh6fUWi_OBKVGfKkLSHnn7z_TA9k7nPCAJ69l BxMT1BnZWzVQeF7eLZ6jN X-Sonic-MF: 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 To: Eli Zaretskii 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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> Date: Sun, 26 Sep 2021 17:56:03 +0800 In-Reply-To: <83o88fom1k.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 26 Sep 2021 10:04:07 +0300") Message-ID: <871r5bvex8.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 27 07:52:57 2021 Received: (at 50660) by debbugs.gnu.org; 27 Sep 2021 11:52:58 +0000 Received: from localhost ([127.0.0.1]:39914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUpBp-0006W7-FY for submit@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 ) id 1mUpBn-0006Vn-G5 for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <871r5bvex8.fsf@yahoo.com> (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@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> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 21:35:39 2021 Received: (at 50660) by debbugs.gnu.org; 29 Sep 2021 01:35:39 +0000 Received: from localhost ([127.0.0.1]:47371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVOVX-0006uN-7Q for submit@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 ) id 1mVOVV-0006u6-Az for 50660@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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tD_XIUjq FOUrYcZcXpf1MYMLoFy.glcDMt1K2EIUmerD6epW4aAEoF5dprBa_CBrdBOadb_ZwN9rZ7M_ODY5 F7xQ.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: 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 To: Eli Zaretskii 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@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> Date: Wed, 29 Sep 2021 09:35:24 +0800 In-Reply-To: <83v92mkzft.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 27 Sep 2021 14:52:54 +0300") Message-ID: <87k0j0rwo3.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii 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 */ --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 04:44:22 2021 Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 08:44:22 +0000 Received: from localhost ([127.0.0.1]:57796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWad4-0002gH-26 for submit@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 ) id 1mWad0-0002g2-Pz for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87k0j0rwo3.fsf@yahoo.com> (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@yahoo.com> <831r5l5d6d.fsf@gnu.org> <87h7egy8jo.fsf@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 05:46:32 2021 Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 09:46:32 +0000 Received: from localhost ([127.0.0.1]:57878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWbbE-0006UE-Ip for submit@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 ) id 1mWbbB-0006Tw-OK for 50660@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/tq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pXQW1pwIE_tj1HtCioiyFdyVZ zcIehMMIz4agRUUKz_XXuj6BcAZ_X7FTYNxT0GyQ0_hrRZmtPR9ULMrh6m_krRQE6FcOPOhJ3QWb O3IreVp5h6BAXuRj8igHtJyuyNkYluCwfClRNZuhxiVfMGC5nK.1V37rRy9R94RJUnDoymgRQ_Do sLNreqSezqTaga8vAIWMa5r7X5Hp_lDtnQMkMEy39LSwAyEef0AzP2_m5vqeEycgKU2X3RDc4Rw. JcOxrzCZ0lomGi.WJl_KNl9T6lwqsDB2gfrzxi7QQI8YVa31GpaRzn8tEVE1bNyNd0XdjpOQ8TKh 5xrBs5aL14T0fG6pn4A-- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> Date: Sat, 02 Oct 2021 17:46:14 +0800 In-Reply-To: <838rzbddfa.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Oct 2021 11:43:53 +0300") Message-ID: <87mtnrdajd.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 08:53:14 2021 Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 12:53:14 +0000 Received: from localhost ([127.0.0.1]:58185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWeVu-0001Q8-6R for submit@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 ) id 1mWeVs-0001Pv-La for 50660@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/3y5yjLYxekUkoNIkIydJdvF1Bz6rzI41houjANJ7OJKEjh17siBwAbn8nbEsBtZH9QvyQ4kAAL8GvWkzLwoMBMLk7cCrdvUR0OAHqPd2grce/dHnC8yyphE28xQelBTdU890yCqZc/7Zp/8rmx6X2uvXbdeQ8uuE0XIHVa/Hhum/Fp8fukpmLZ2AzdEox9I+YpzHM0b4eHQavyRyN+O2I1xIQbvQ0Zb8iML/rOqGp7mALQubojjjgH2cwxlIHU2LKYgy+XOpxn24AlaAVu8byXAT38JluhI6KSAZVeUdIzhndqWXI8zw== X-YMail-OSG: ATQMEtMVM1nu6YqrKfMfP.onri87t.w_Mbqiv4Db.BAFKIixdLcAmJmn3V0Ilww 3tSp1u5ejKGqifGI5vFd4PR_lU6vCJaXKrhjrAshXTSMI7rz4A1gayJ470Y7X4pq7PJ0NBQZG8Zf eJ78PTfK73QpREP99TjkYa0C1nEFo1smoVGYXYV_DadcVuaOGOaXsm2JeRqOMoidhix3PurVRmI8 nkVc_ztvWX2u_Rj0gsvmXPw9_QpWtBj64P4o7vkA5lFQaRGRHA7yYZhLA3yt2VFDL9OQmXu7UDhY YsegLttXlL2e3E2i93HHbsOxiltxqYtIIm7BeMCiRfezSGK79kMVIOHrj9ddwoxcWnOJYB_zJZK7 mvIcOa9WRR97ax4604c797IbFf7UjCqQE.ka5Whgh8xHnIdYkLPr6HMBWHVK6M9vr2HAV1sfpVID IGvLm98nuBIYmDIjVpNtNFYRBOAMhg_zmi8jof1d.s6q2t88EL7muki5_ruVWnavuHHhmCNK5MdZ nHxQLdE5DUXSBd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BU8vOs9p34Wk_WEZ7aEmT_vKU7klzLXZJxVBNq6aczLo07kDqKNlIPfZa5L.Q7vCD50s BW0e7EdnsoewjxrYIQ.zA9UDqRoT2gePADeop3nmHcc0dH9rG5thk8x4RmvTGn63ZdNxG1RqavSr 59zHEBktiLZo1W70d1nOGquUNZXYmr5hCOZSmWDi5TUPwL9mbMjSZK77tCG9mJMcySxr4noKeFZ9 q7_HKBmVrKB2KfFAt2rxEhW1pedWQ7ETSONAqTZ8UO.RQ6DRvSF5uIrKYlKLDDzFwjS2d28UdayY nFPwO56n1yAVzUFNSKRvlRe8PX5CMXU7rP3MEUzi4obm38bKPtYr7xpTp86Vwk3fg7fF.ThWZCjk .MfBaowOoCpTyiB_RJDJUzIOaEtxydj9isWubNNUiZaowQDvZtMTpY3Pqw8hH3_9kJhWxtZzILcj SSo3KyRtPGW1JFkeBcawD3Q_mp0dIBkfNlfd17FJslIr9xaPyQ1BGCJYpwrOh8HbjbpDyRBedAqA Na9noNaRtYP9CKFWJG5EC7ZJRwEVLeRqNWh9o2hs58F65G_thkYQP2HsOcmYcjU9YvQm9Vsy__oB DZ.jCoHLuwgJ5EIl9qg.XPYvUOMT0i7jAlUJ3P3HHGUOKxZl5i0FGSzHGxXOMVNu6d85PaAuaRdx 6QhLckRCylJ4t98c9O7dbVXr8KyvlbbhmdyHJ7gZKVyYMmEfPt12zYDaVbuceteSjMknUB.PJH5m 9UCOrH_rSg7SOoFdzKA-- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> Date: Sat, 02 Oct 2021 20:52:58 +0800 In-Reply-To: <838rzbddfa.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Oct 2021 11:43:53 +0300") Message-ID: <878rzbd1w5.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii 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 */ --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 04:58:34 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 08:58:34 +0000 Received: from localhost ([127.0.0.1]:34631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mawZN-0000oe-NA for submit@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 ) id 1mawZJ-0000oP-O4 for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <878rzbd1w5.fsf@yahoo.com> (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@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 06:53:04 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 10:53:04 +0000 Received: from localhost ([127.0.0.1]:34742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mayMC-0003pC-88 for submit@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 ) id 1mayM9-0003oh-Ty for 50660@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+VwzSAq5UBujrIb+x/M4qaV68PpvtMII2+Ab7/k7WerpFft1meZD7BXgUPKgJLFwW4Si7Z13D/fWJ3PTEzNLo8vFkSg1WSqErVw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634208776; bh=uOuCR1WoFSp5j7zpyVM+x1HhfCu1zlg171ucqDdbWzs=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=LQVIe2LZAUy6Gk/e5CbmP/szB/MZYylT2nUAUi4tY/eCW750BlfJ0pXLD0iNTMfxG4fZUA6YVe3TxpbrDldwlSthz6mxWZDr+mTkAxVh5XaMt1CthRewCB6z7zl7D6KMyW7wGA/hNl/RHpJitAai0h38leDuZ0+rC6H0A3187cUopz4xTgunIsDmCHe+7Ni0/Xa6dXR7cNNBL9Mv9QZKNlmil/ZVm13LhsZrpXeg7Bw9I2857mPiBqUP97QcaHtTFvWzEIWA+ilcUWY2N9p+CekU4gk3YlByr8tKWtScy1aT+siA61ExRoPY3SOj6Szb8Dg7OxUcp+NS+0G5nWHLkw== X-YMail-OSG: Z1DiWOAVM1kuZyfh2lwJJIuYrOA_vfx4VCvfApJEKabN8l3mzxLnuQH8Arj5.sv 57o2VhKM5XBYDW4uMji1uAep7qtUkEZ5H2GwmjDuUIzELBPaRlYNF8C42H4f1o6RiObe1F7e0OzK y8238jL0gYKBL1K20bIq1TniyB3worvAwk.qjemMJoxflvWTXWwQkXAiDeNe3z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cOGyt_Yesi0VT49L X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> Date: Thu, 14 Oct 2021 18:52:48 +0800 In-Reply-To: <83wnmgkmok.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 11:58:19 +0300") Message-ID: <878ryvnain.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 07:12:00 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:12:01 +0000 Received: from localhost ([127.0.0.1]:34799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mayeW-0004J2-Mn for submit@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 ) id 1mayeR-0004Ik-7G for 50660@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@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 To: Po Lu 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@yahoo.com> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> Date: Thu, 14 Oct 2021 13:11:47 +0200 In-Reply-To: <878ryvnain.fsf@yahoo.com> (Po Lu via's message of "Thu, 14 Oct 2021 18:52:48 +0800") Message-ID: <87lf2v7te4.fsf@gmail.com> 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 , larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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" 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 07:26:10 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:26:10 +0000 Received: from localhost ([127.0.0.1]:34831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maysD-0004fR-RT for submit@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 ) id 1mays9-0004es-Gb for 50660@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; b=c1+j0PRcnmgfMDaFpOXZal2+vEmMsBNjVmWSW65A+yplHxZs1RLzBENf/sA/EAQqy1kyYJitiH7RYD00k49djnVnGyenncXuHLzO/vGGnlsC8t5znmV9dkvIyHVXeCrlfFxeL8uJzpE89lA3B2GMslKGIo4jBIEcO1FuVx//X1WulyUZpLsh/DFMdlXN/gaMFGH1lWbvpPk5E5VDd1ETyL0WC0MM/2/sgBgfyLpzd2TTPPq10zqcD0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K3zBHBgISh0qevwxFib1O4ZcCgtoB.c9rHDaPFeH602b0zKF.WzV8.fX6iSmAO4RKP9scE dyzruIc1KyiV1Nc9AbvhLlkZYmK0utsLN4z8z_J5xP9Ym8MUti1kqHz38D5PcE85Wk2CWnWPFoU5 lULyavqikXf2mYPFgWd1.SDDx05bG8mLduAu437j3D8fbPCwOZErk4ZVnyRzg_vOY.V_pSox.tUE QbleoyOz.aA9T.ItTb050GJsV6ZkJKcqH0BrwhC3gSjgFvQfcljuIR.V3hj4- X-Sonic-MF: 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 To: Robert Pluim 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@yahoo.com> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <87lf2v7te4.fsf@gmail.com> Date: Thu, 14 Oct 2021 19:25:51 +0800 In-Reply-To: <87lf2v7te4.fsf@gmail.com> (Robert Pluim's message of "Thu, 14 Oct 2021 13:11:47 +0200") Message-ID: <87sfx3luf4.fsf@yahoo.com> 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 , larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 07:36:10 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:36:10 +0000 Received: from localhost ([127.0.0.1]:34838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maz1t-00074f-Oa for submit@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 ) id 1maz1p-000745-Cn for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <878ryvnain.fsf@yahoo.com> (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@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 07:54:56 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 11:54:56 +0000 Received: from localhost ([127.0.0.1]:34843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mazK4-0007XJ-DP for submit@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 ) id 1mazK0-0007X4-8U for 50660@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=L01BmlyqX8GRstnqIinPT46Y1Mlfm2xRb16kA4Xe5Afj5sSpFiGyy8fhDIXM+htDSpVvu08nZhp4QWh+SC7ijsPvL8rQbwXkpXMUqXdJnqO8HWmRJm0s25SkDuiQIdFpT4IRGwJCVZ+axaWdiVhArbYA/LfvEQPSobc3HUB7q+6IlYRyOZ86mKPGTdA+9MWxYG17J2GD+F5oDfmjd4/VBZ/gJlMuuFvfqhOD4Xs0Y58UNxNs6MTejxhombZsaaQIpgJOHSzx+lHOChRNhjh+qerIuHfakS+HaTwnISrGZbw551N6jyJuTMG5wWd5+wxVeaNdJe+t9Febqtn8ekDtmQ== X-YMail-OSG: hXLVMu4VM1nvAnlboHpKr_BmFARg8CJIThVokeuog.067UOReQpcKA11jh0pB73 jnx0yJoybiKFyYQjEG_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vMHttquBI9Y2RQViyp29yTprGC_84waHO fx6OMmmFC8ivm.7K58HMnzGyW6CwuKLR_SsU0fI.W3.FWreeFnzdg4RfxZg-- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> Date: Thu, 14 Oct 2021 19:54:38 +0800 In-Reply-To: <83mtnbltyp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 14:35:42 +0300") Message-ID: <87mtnblt35.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 08:10:54 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:10:54 +0000 Received: from localhost ([127.0.0.1]:34877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mazZW-0007wB-2k for submit@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 ) id 1mazZS-0007vw-Qe for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87mtnblt35.fsf@yahoo.com> (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@yahoo.com> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Thu, 14 Oct 2021 19:54:38 +0800 > > Eli Zaretskii 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? From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 08:16:43 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:16:43 +0000 Received: from localhost ([127.0.0.1]:34890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mazf9-000871-DI for submit@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 ) id 1mazf7-00086l-2d for 50660@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=ReZdTEZ3S6eztAQyR9IUGmlUgqNfhM9+Ap8xyRvZ4/LLhprh5eVktuKsx8OcdrxYlKEyUcspndUvdQg/4FgzvUQ2zA8tyVKYKEuhp0clv1P4Nru2ekRM5yoM3WT3dySL/uG6jAJKggf9j0sY4cpHBC3qQSZXk8jyg088d0l3AXBn2rG0x3RNQscpITwmZJvP0EwLVhV33CdNMTk7WZdq5YAm1x1Qd71+YqwicxvP/i0QD7/UdmQTzvmU/78TkvxRZTRIRvHcbM65xU6B1qW/MAdXU6apg0eFJG6SdnBVXjUaDld1gMJ30F1HSpIjkfOuLTu9aIsQV0BiEVaodtPhAA== X-YMail-OSG: FamwwMkVM1lh3023NNpS5xtp7U9nT8yiT5qmdAdCAGZZuoMEjuhp2f7UBJVtbuh KtiUw0BS9HGLun3F_r1bFUD4i9DPh8hOUsTl26_Az0YZSvU2Bn49xRuouO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 kw5cfYzEUeX2YCtdXws9HblHnY9fLi.7jVMvDT5hfCGQuLf4aViZmYPBePg-- X-Sonic-MF: 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 To: Eli Zaretskii 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@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> Date: Thu, 14 Oct 2021 20:16:23 +0800 In-Reply-To: <83ilxzlsck.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 15:10:35 +0300") Message-ID: <877defls2w.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 08:20:56 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:20:56 +0000 Received: from localhost ([127.0.0.1]:34907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mazjE-0008Fe-DA for submit@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 ) id 1mazj9-0008FK-9w for 50660@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <877defls2w.fsf@yahoo.com> (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@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Thu, 14 Oct 2021 20:16:23 +0800 > > Eli Zaretskii 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? From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 08:27:53 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:27:53 +0000 Received: from localhost ([127.0.0.1]:34912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mazpx-0008RW-4d for submit@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 ) id 1mazpu-0008RE-Op for 50660@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+NfrMKkvRwmVaLAuwHZX9qppgv+rYgj8L8brNzeR4ltQejxMg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634214465; bh=4hKiS3zu13Jfz2xDI5bwYf934hPy7Mhj5HG/fCgcwkA=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=gVgtEivDT8pIwGPvbG/e97/yP6a3i9nHTkJyOUemxbXmkm1f1IPLYZ9cUZ8KecahoCTLLw+qT+kMoLeABXxpohWgqEYoNYrkPH5q39nN/bRFuWcr7gvvYsing1QL+r8otawqD0Av3cSjuLizycm5vKpsxn4ldgsOD0rGVvWf4ALGgE7M2tzE0NySWYw/f7kT4d6VKy4zQqSsylUCyumnw5BQuJb2X6wWwLUGijMuQyuxDVjV4X6MYeFEDnqg56R9+tih68WblDZnGRyKoCLcumXBbeS13uCnqNRIiC9Ryuzd23cIR/ix045FSuoSWw3YFp8w3aaTnzwa9nKxWuE3Ug== X-YMail-OSG: EXu62XgVM1n4atFzvKzqtFDOYpacDpdHa75qkuMLfE2jDmtBTW5jr1sF6fBOefz IV7Pze7kcLKtsCcWLUEoCeo6r6lGk3X9EXr42lF47a13ghU2KY.OORjFvES1RbnrXFR5lQ6ijxN8 rL57Kf_dmgUMvJ4bwF1LBcGWDW3TsIV6Bo1SdsK_vsNDIPk3CVIvhn7eHwijsxbi2M2mFPnClPhi jnyeeI6iukT0lGzaRMP4jGMsth3JyzFuivDcs4RkJdsxBTz3kpXQ7KE.9NlqJBGSBaARKsf5GOd8 WXSDDYlVd5zLfWvm33CxYeOu1a6vC.uV7_jIpRAIPDHStdbe8wWLD40mtse5Hm_aroCdx7_jonpV nWCKFJ_H33wmZsrbWUn0ReNq_mnnYT3baMWBMfrBTfNH8104Zf5v1w0XAE8FFzkSIdNy22vKPfh_ Man0S5RQdaWgRD3petHi_ZS6vRC6nPi6tf4i8D5snVJUq6d7ttt4aq8DJN4HZ.Nwm8yVBUkYKsRg ZoX.xAcvaWwMGPkkj2thYqW2wKODqlVnDpLX_uhj5IwxuxdpfELSw6yMJr8pg2oatjnooPNTMr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O0as2dhgWbu3rKkLdUAlhlqUEifhFUght5KRu6y5wC0lJ3t9hhgrWrcKDe5.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: 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 To: Eli Zaretskii 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@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> Date: Thu, 14 Oct 2021 20:27:34 +0800 In-Reply-To: <83fst3lrwr.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 15:20:04 +0300") Message-ID: <87o87rkczt.fsf@yahoo.com> 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@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 08:44:57 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 12:44:57 +0000 Received: from localhost ([127.0.0.1]:34929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb06T-0002e3-8z for submit@debbugs.gnu.org; Thu, 14 Oct 2021 08:44:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb06Q-0002dm-57 for 50660@debbugs.gnu.org; Thu, 14 Oct 2021 08:44:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45836) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb06K-0001j3-Nf; Thu, 14 Oct 2021 08:44:48 -0400 Received: from [87.69.77.57] (port=2432 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb06K-0001Pl-9E; Thu, 14 Oct 2021 08:44:48 -0400 Date: Thu, 14 Oct 2021 15:44:46 +0300 Message-Id: <83czo7lqrl.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87o87rkczt.fsf@yahoo.com> (message from Po Lu on Thu, 14 Oct 2021 20:27:34 +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@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Thu, 14 Oct 2021 20:27:34 +0800 > > > 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. Correct. (More accurately, not if the character is multibyte, but if the character cannot be displayed by the font of the ASCII face.) > 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 That's not true. See this part of x_set_mouse_face_gc: /* What face has to be used last for the mouse face? */ face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; face = FACE_FROM_ID_OR_NULL (s->f, face_id); if (face == NULL) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); if (s->first_glyph->type == CHAR_GLYPH) face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); else face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); s->face = FACE_FROM_ID (s->f, face_id); prepare_face_for_display (s->f, s->face); IOW, we do call FACE_FOR_CHAR to create a mouse-face variant suitable for non-ASCII characters. > while the highlighted area can span many faces that could have been > adjusted for many different characters). If the original text includes characters that need different fonts, then each run of characters that have the same font will produce a separate glyph string. A glyph string by definition has the same face on all of its characters; when FACE_FOR_CHAR produces a new face (because we found a character that needs a different font), we end the glyph string and start a new one. So such stretches of text will be covered by several separate glyph strings with mouse-face, and each one of them will have its own face from non-ASCII characters by virtue of the above code. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 09:11:47 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 13:11:48 +0000 Received: from localhost ([127.0.0.1]:34955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb0WR-0003Rf-OG for submit@debbugs.gnu.org; Thu, 14 Oct 2021 09:11:47 -0400 Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]:44373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb0WP-0003RR-1W for 50660@debbugs.gnu.org; Thu, 14 Oct 2021 09:11:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634217099; bh=n2s+eLwMy4GUsJqoVTJg1vlG+P+DM9Gbv/AaJOwQsXY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=RQRZWkCjSEcrpGtPB3c1ANa+Mck5JmUQoSAIGpvbtPkJGZsJakkOhGvm0II0bo0DO15OkhMwII5jvVHasNoZX+7KBHVOatnkR/Qj1bJL3NYpiL5oWZKUrYDBb105rBWmmYvqdJxMVEh+AERPc7QAYHYeUHYTCAlMz6Bj6REV8QNwt8u/teAH74WD9Lr0yAVSlvJcC/wOgFPbdG5RfZGp1N4EYCcJkoee3Xrdwjzt/UavRflvfsL7JVzSV7CVquvqrWgHPhiRXVeTl2T87THBDOXivwykXhOS05VZjhZ3lcWq3UElyEIqfjUIscAp/RrsXaJvUWzKTbW3YjH90HnjGA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634217099; bh=gLz/2tVHAN4X3Bh9iRxAKlRSnavdKUK1FVQbS9aJWVe=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=s8mzJRFDi4Ox58WCrFCuwiNdupKZGGFVmE3jfnbkhJwXalJ7KpyNBQ11WbHexDR104l2ui8kCMX2NQkzzylaCZDic5aUkzOGZ1dMTeSHqIlgBZl/t9VcYVUIlqqd10GFrGXQoHHBMzqPII/0bBimkHxpn+dyAAktOHt3K+b3W2J4RUKswMvoc2nUn0DtoIMXxe/sU2noUWXLdueZDiw6MsLYbFjIlzKlfUGD3qzWklT72KJR9Si17ma0iD6cqOWK13oEl73kuKoV/dHtxe/KEa/8STGeRHByGpPIhAJuHK8JLOihMKAWbiC3IQow0hRECrqQk72Uyjo/b2VERc01DA== X-YMail-OSG: Nh4e.MEVM1nta_wB6REwx1sg9RBpFtCgbc5wLhzGC2CIRHbfJUrziwtM3YqXogD 95ZYJzdvVItiRdXD9nKMeGdv29y5WQDnaNMFpBzXCr9Q_NVj9DD8HHtKk7P2XRog9VEBDDK1EkPF OUy6e.iPRmWQmFKvPcnFHEqmdg_vevsNPJJrI0cYPPQU6PmZcy7akIhWYG1qpqlzbeQ6w2VczEyf i2WuXvZ89OgmKFaduC5SXswy37Ku511qb6Iwe7rSblqgBtrk01dCVndU6yTXjjf20sCJKFSSUcrt OAnjSXyEnlKtMiIZLu.pEdTNdc08gSPcGGWk7HBMnqI.EvN4qm3Nv1ajVxP4iU5IB9DdpVxeP9BW 69kfPx_uBan3Lovi7AYWhdt.LZOLs5ONf4XWnzE9ncpJp21Gew77KlgEBOpGCToGXXSb1mjzoy46 NwYq3bg.fu02FjiasMmfGSpoa4U.Jfr9k9ctXZaK4sqCSMFFrQbtNJEQhORHpmQo.9UiwpLHdHzq a7E5b4ynRNEOogO22CAO4OOJbV.BuzvKxPMTCD51ail48vlwsaF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G71aYxchSxdl0e5yBk2uN o9PBHi9Q4ZpFVuZsF0BtK_Apgi.6M01ogQc4gmRmy3afbo9aItT1IT2bEsYfT9IuzNs0ARI8hFZI N_KFKelv1_PEHd4Ou3gYDzyeh5J3TjhIu3U2_3NTa.zMg.Bqc7eEEuDu5_lZbZgy7K7.NH8YQCyy 8ZyJvuI__1otmNoooDNjGdP5OHzWsN2kipQbLi6IllqyfQOO3UuOH_DHXJKELUcQ6G1j6fkO.zgj TrpNzJbBw82hbNTa8k8Trcj01LFtskO5mkrGCErHVPFLcTbZ6aNx0rUUwOgabqt8KxEsTIXDccaY o96H_BEr7mdL7o3o2aPhfOMrMzpaAK2M_CvEJfWvnu3qH8dBjj68Aobc9L3yAF1XiK1p57Mcu6ir bWVxOy3ev_JRt5PGiWzC3urahg3ay7fnVl2oLFwvTwUWYy93DOvfFWfu9lJSiVSVy8mslr0FcQGU C3dVrwpCET1_KXZQzFvY1JTv0qtJmKtCYTJ0vllpgMJkyTr3F4ZmoJ2R5WdDBvGT_J12HvsjIWA7 N4XMKMbU2BtTNmelVSm2PTWRNMHO.hTGU.KEdpVppkNJx00WWaY8bSrs1S3NuBHLV.dJ3GCIcgqv CDJJp_0mOTmW_Urmt7oH1.MxVog7V.ReYEPKwZd7iqzVktsyD.98eoI5DBDNJpg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Thu, 14 Oct 2021 13:11:39 +0000 Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID b5a4b3a2b389963507b7d583bacdc846; Thu, 14 Oct 2021 13:11:35 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> Date: Thu, 14 Oct 2021 21:11:31 +0800 In-Reply-To: <83czo7lqrl.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 15:44:46 +0300") Message-ID: <87h7djkayk.fsf@yahoo.com> 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: 304 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks for the clarifications. One last question though, if I make the change to setting the face in draw_glyphs, it would be OK to remove x_set_mouse_face_gc, because the face is already set correctly by draw_glyphs, and no other adjustments to the GC or glyph string will be required, right? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 11:51:15 2021 Received: (at 50660) by debbugs.gnu.org; 14 Oct 2021 15:51:15 +0000 Received: from localhost ([127.0.0.1]:36845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb30l-0004Cn-FF for submit@debbugs.gnu.org; Thu, 14 Oct 2021 11:51:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb30i-0004Cb-9t for 50660@debbugs.gnu.org; Thu, 14 Oct 2021 11:51:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52340) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb30c-0007Oj-Vb; Thu, 14 Oct 2021 11:51:06 -0400 Received: from [87.69.77.57] (port=1916 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb30c-0003kt-JB; Thu, 14 Oct 2021 11:51:06 -0400 Date: Thu, 14 Oct 2021 18:51:04 +0300 Message-Id: <83bl3rli53.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87h7djkayk.fsf@yahoo.com> (message from Po Lu on Thu, 14 Oct 2021 21:11: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@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Thu, 14 Oct 2021 21:11:31 +0800 > > Thanks for the clarifications. One last question though, if I make the > change to setting the face in draw_glyphs, it would be OK to remove > x_set_mouse_face_gc, because the face is already set correctly by > draw_glyphs, and no other adjustments to the GC or glyph string will be > required, right? No, I think it's wrong to set the face GC in xdisp.c, because the GC is fundamentally terminal-specific, so it belongs to xterm/w32term etc. I'm not even sure xdisp.c knows the exact type of GC, which differs according to the platform. The logic of selecting the face should indeed be removed from x_set_mouse_face_gc, but the calls to XChangeGC etc. should remain there. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 21:28:32 2021 Received: (at 50660) by debbugs.gnu.org; 15 Oct 2021 01:28:32 +0000 Received: from localhost ([127.0.0.1]:37460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbC1Q-0005GQ-3P for submit@debbugs.gnu.org; Thu, 14 Oct 2021 21:28:32 -0400 Received: from sonic316-21.consmr.mail.ne1.yahoo.com ([66.163.187.147]:33589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbC1O-0005GE-46 for 50660@debbugs.gnu.org; Thu, 14 Oct 2021 21:28:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634261304; bh=dQRgKCY8aXkZZWYbcc5AoMnE8zCK1pBr2cGIyGqx8lo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=KSjTC0VM8kzWy4hTZsmZOHHpFmGo1PTBPTLBidpKGb12cpeUU/vV6JnhJBRWoliwr05LlZrmuakT+st3DpYrb51tB8iyyKH5Ud+aQb38stum7mI3zBF6WwxDWy0kh6SvSGP/+nnjf71XQEHAAfwGcE2ThEYZ6lyImusZmeRJm0siAV+5nrsn1yQtSJf3M31y48gbgF4ZOGFebM0LEfEQxHTjY3HtTE+O9rJ+4BA+rPoTo+APO7vWgF8lv06DX3C7zQ/7V+4bfSCeXnclTBD/vI+d7NuNZ+nsS4be4d8wSsJCqGcniWKwV59AOfPhLhtjMIu4UQ8x9P3rKKZVHJ9YcQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634261304; bh=GZDGUqtJcUhIZWD0Cw6Ny4nG2TabNHHy9gZ0NittcF2=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=aH8b9ZqF9c6hN4HakilhxT4bDJmFmgcJDPF36LsA2Vp9XyTS3WgxUKPL13ye7+zl8HtoOtNoP8eplGSFl9Je02STlMMgAbhgegIs8+1qRoJjS1DZHusOy1VdeLxNqGDh9+uAAx6R9dL2MHpnSr2ebdXCb9u9I9W/o/mQzjusafWP7xqFYbuDenT2+YibPM/YDfERRyefCatBM7u+NWu2HGpCcnhqc/JbOwDUckoPR5lyRvOnmqZu5329J449szuKm6ZG2iggL2ZiK3YshHJ1S4lX6JLPSvf8cA9rbOeyk8nTNwaedp7g+r6Y9Dtf2qRZGCln39/g7gI8ZaiZ0C12HA== X-YMail-OSG: WZ9IeH8VM1lSfgTzhrCHk6AmG0AXiJ7EPEg.DNY5kO4QdM0YZ0FVCbGgDPNQg4A xzFlff7wgjm9_zV5GAJrggZ47aVWTHYNiOZC9VqSx_hX11mCWnbTEsYnZA1xpKZ7f0h63Dz12TFR G9dBf0sbwPT3Gfgov9FfCvq5P1AIuaxq5bIWHMU2thTi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fxw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Fri, 15 Oct 2021 01:28:24 +0000 Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID cc908c8261400a13b4e622050a758047; Fri, 15 Oct 2021 01:28:20 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> Date: Fri, 15 Oct 2021 09:28:17 +0800 In-Reply-To: <83bl3rli53.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 18:51:04 +0300") Message-ID: <871r4njcum.fsf@yahoo.com> 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: 13330 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > No, I think it's wrong to set the face GC in xdisp.c, because the GC > is fundamentally terminal-specific, so it belongs to xterm/w32term > etc. I'm not even sure xdisp.c knows the exact type of GC, which > differs according to the platform. The logic of selecting the face > should indeed be removed from x_set_mouse_face_gc, but the calls to > XChangeGC etc. should remain there. Thanks. Here's a patch that should remove the issues you pointed out: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-minor-issues-with-text-display-when-cursor-is-in.patch >From d9fa01cca632672efd20272131acd4e13b0b4106 Mon Sep 17 00:00:00 2001 From: Po Lu 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. (fill_composite_glyph_string) (fill_gstring_glyph_string) (fill_glyphless_glyph_string) (fill_glyph_string) (fill_image_glyph_string) (fill_xwidget_glyph_string) (fill_stretch_glyph_string): Set s->face to mouse face whenever appropriate. (set_glyph_string_background_width): Update background width and s->width to take into account differing :box properties of the mouse face, when producing strings for the cursor. (erase_phys_cursor): Redraw mouse face when erasing a cursor on top of the mouse face. * src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under mouse face because redisplay now does that for us. * src/w32term.c (w32_set_mouse_face_gc): Likewise. --- src/w32term.c | 16 ----- src/xdisp.c | 158 +++++++++++++++++++++++++++++++++++++++++++------- src/xterm.c | 16 ----- 3 files changed, 136 insertions(+), 54 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index 9cf250cd73..07a5cd3564 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -954,22 +954,6 @@ w32_set_cursor_gc (struct glyph_string *s) static void w32_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - /* If font in this face is same as S->font, use it. */ if (s->font == s->face->font) s->gc = s->face->gc; diff --git a/src/xdisp.c b/src/xdisp.c index 012c2ad8bf..c61d6a943b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28128,6 +28128,14 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, s->font = s->face->font; } + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + s->font = s->face->font; + } + /* All glyph strings for the same composition has the same width, i.e. the width set for the first component of the composition. */ s->width = s->first_glyph->pixel_width; @@ -28164,7 +28172,14 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, s->cmp_id = glyph->u.cmp.id; s->cmp_from = glyph->slice.cmp.from; s->cmp_to = glyph->slice.cmp.to + 1; - s->face = FACE_FROM_ID (s->f, face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + } + else + s->face = FACE_FROM_ID (s->f, face_id); lgstring = composition_gstring_from_id (s->cmp_id); s->font = XFONT_OBJECT (LGSTRING_FONT (lgstring)); /* The width of a composition glyph string is the sum of the @@ -28218,7 +28233,14 @@ fill_glyphless_glyph_string (struct glyph_string *s, int face_id, glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; voffset = glyph->voffset; - s->face = FACE_FROM_ID (s->f, face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + } + else + s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font ? s->face->font : FRAME_FONT (s->f); s->nchars = 1; s->width = glyph->pixel_width; @@ -28281,6 +28303,16 @@ fill_glyph_string (struct glyph_string *s, int face_id, break; } + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + struct face *face + = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + s->face + = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, face, + s->first_glyph->u.ch, -1, Qnil)); + } s->font = s->face->font; /* If the specified font could not be loaded, use the frame's font, @@ -28310,7 +28342,15 @@ fill_image_glyph_string (struct glyph_string *s) s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id); eassert (s->img); s->slice = s->first_glyph->slice.img; - s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); + + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + } + else + s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; @@ -28324,7 +28364,14 @@ fill_image_glyph_string (struct glyph_string *s) fill_xwidget_glyph_string (struct glyph_string *s) { eassert (s->first_glyph->type == XWIDGET_GLYPH); - s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + } + else + s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; s->ybase += s->first_glyph->voffset; @@ -28349,7 +28396,14 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end) glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; face_id = glyph->face_id; - s->face = FACE_FROM_ID (s->f, face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); + } + else + s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font; s->width = glyph->pixel_width; s->nchars = 1; @@ -28598,7 +28652,12 @@ right_overwriting (struct glyph_string *s) /* Set background width of glyph string S. START is the index of the first glyph following S. LAST_X is the right-most x-position + 1 - in the drawing area. */ + in the drawing area. + + If S's hl is DRAW_CURSOR, S->f is a window system frame, and the + cursor in S's window is currently under mouse face, s->width will + also be updated to take into account differing :box properties + between the original face and the mouse face. */ static void set_glyph_string_background_width (struct glyph_string *s, int start, int last_x) @@ -28620,7 +28679,67 @@ set_glyph_string_background_width (struct glyph_string *s, int start, int last_x if (s->extends_to_end_of_line_p) s->background_width = last_x - s->x + 1; else - s->background_width = s->width; + { + s->background_width = s->width; +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (s->f) + && s->hl == DRAW_CURSOR + && cursor_in_mouse_face_p (s->w)) + { + /* We will have to adjust the background width of the string + in this situation, because the glyph's pixel_width might + be inconsistent with the box of the mouse face, which + leads to an ugly over-wide cursor. */ + + struct glyph *g = s->first_glyph; + struct face *regular_face = FACE_FROM_ID (s->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 (!s->row->reversed_p) + { + struct image *img = IMAGE_FROM_ID (s->f, 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 (s->f, 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 from the + offset. */ + if (do_left_box_p) + s->background_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) + s->background_width -= max (0, regular_face->box_vertical_line_width); + /* Now add the line widths from the new face. */ + if (g->left_box_line_p) + s->background_width += max (0, s->face->box_vertical_line_width); + if (g->right_box_line_p) + s->background_width += max (0, s->face->box_vertical_line_width); + + /* s->width is probably worth adjusting here as well. */ + s->width = s->background_width; + } +#endif + } } @@ -31755,10 +31874,6 @@ 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; @@ -31829,13 +31944,16 @@ erase_phys_cursor (struct window *w) mouse_face_here_p = true; #ifdef HAVE_WINDOW_SYSTEM - /* Adjust the physical cursor's X coordinate if needed. The problem - solved by the code below is outlined in the comment above - 'get_cursor_offset_for_mouse_face'. */ - if (mouse_face_here_p) + /* Since erasing the phys cursor will probably lead to corruption of + the mouse face display if the glyph's pixel_width is not kept up + to date with the :box property of the mouse face, just redraw the + mouse face. */ + if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p) { - get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta); - w->phys_cursor.x += mouse_delta; + w->phys_cursor_on_p = false; + w->phys_cursor_type = NO_CURSOR; + show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE); + return; } #endif @@ -31874,10 +31992,6 @@ erase_phys_cursor (struct window *w) draw_phys_cursor_glyph (w, cursor_row, hl); mark_cursor_off: -#ifdef HAVE_WINDOW_SYSTEM - /* Restore the original cursor position. */ - w->phys_cursor.x = phys_x; -#endif w->phys_cursor_on_p = false; w->phys_cursor_type = NO_CURSOR; } @@ -36042,7 +36156,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..961c61c245 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1563,22 +1563,6 @@ x_set_cursor_gc (struct glyph_string *s) static void x_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - if (s->font == s->face->font) s->gc = s->face->gc; else -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 15 09:44:07 2021 Received: (at 50660) by debbugs.gnu.org; 15 Oct 2021 13:44:07 +0000 Received: from localhost ([127.0.0.1]:38483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbNVG-0000P3-PH for submit@debbugs.gnu.org; Fri, 15 Oct 2021 09:44:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbNVD-0000ON-Q5 for 50660@debbugs.gnu.org; Fri, 15 Oct 2021 09:44:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58732) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbNV8-0007Y8-C1; Fri, 15 Oct 2021 09:43:58 -0400 Received: from [87.69.77.57] (port=3656 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbNV7-0007g8-VH; Fri, 15 Oct 2021 09:43:58 -0400 Date: Fri, 15 Oct 2021 16:43:56 +0300 Message-Id: <83v91yiesj.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <871r4njcum.fsf@yahoo.com> (message from Po Lu on Fri, 15 Oct 2021 09:28:17 +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@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Fri, 15 Oct 2021 09:28:17 +0800 > > @@ -28281,6 +28303,16 @@ fill_glyph_string (struct glyph_string *s, int face_id, > break; > } > > + if (s->hl == DRAW_MOUSE_FACE > + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) > + { > + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); > + struct face *face > + = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); > + s->face > + = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, face, > + s->first_glyph->u.ch, -1, Qnil)); > + } > s->font = s->face->font; This part doesn't look right to me: FACE_FOR_CHAR could potentially yield a face with a different font, but the glyph codes in the glyph string will reference the previous font, because get_glyph_face_and_encoding was called before the face was changed. Also, why did you not follow the more cautious code of xterm.c: > - /* What face has to be used last for the mouse face? */ > - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; > - face = FACE_FROM_ID_OR_NULL (s->f, face_id); > - if (face == NULL) > - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); FACE_FROM_ID can abort if the face is not in the face cache. > @@ -28620,7 +28679,67 @@ set_glyph_string_background_width (struct glyph_string *s, int start, int last_x > if (s->extends_to_end_of_line_p) > s->background_width = last_x - s->x + 1; > else > - s->background_width = s->width; > + { > + s->background_width = s->width; > +#ifdef HAVE_WINDOW_SYSTEM > + if (FRAME_WINDOW_P (s->f) > + && s->hl == DRAW_CURSOR > + && cursor_in_mouse_face_p (s->w)) > + { > + /* We will have to adjust the background width of the string > + in this situation, because the glyph's pixel_width might > + be inconsistent with the box of the mouse face, which > + leads to an ugly over-wide cursor. */ > + > + struct glyph *g = s->first_glyph; > + struct face *regular_face = FACE_FROM_ID (s->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 (!s->row->reversed_p) > + { > + struct image *img = IMAGE_FROM_ID (s->f, 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 (s->f, 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 from the > + offset. */ > + if (do_left_box_p) > + s->background_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) > + s->background_width -= max (0, regular_face->box_vertical_line_width); > + /* Now add the line widths from the new face. */ > + if (g->left_box_line_p) > + s->background_width += max (0, s->face->box_vertical_line_width); > + if (g->right_box_line_p) > + s->background_width += max (0, s->face->box_vertical_line_width); > + > + /* s->width is probably worth adjusting here as well. */ > + s->width = s->background_width; > + } > +#endif This looks like the same code we have elsewhere, so can't we have a function to call in both places? Also, the indentation with/without TABs seems wrong here. And finally, please always leave TWO spaces after the final period in a comment, like this: /* s->width is probably worth adjusting here as well. */ ^^^ From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 15 20:18:40 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 00:18:40 +0000 Received: from localhost ([127.0.0.1]:40609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbXPM-0001mc-LK for submit@debbugs.gnu.org; Fri, 15 Oct 2021 20:18:40 -0400 Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]:42526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbXPK-0001mP-VQ for 50660@debbugs.gnu.org; Fri, 15 Oct 2021 20:18:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634343513; bh=nR7hsgOaunsaCyqEtq1hMh4fxVLZhbWJOpjhcUaD0E0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=FOLA8J8KXPLHoLfpgNUE0wvZ7GgJ+uEhk8uWdzTObJVLy6rCFyWHzapTbeBDy/xbCR5JVXqiGLWYtqKpuMwfzpxG3j3l0L7TViAGnKTIABqrVqdbXXlQrzoAbiR5jy+me0HK7r0s7UHvOarty67+T71FwIj2PeAvPvTWR03n7JFPvvPsH6SqYolOWfePYfc5o8Ua5BQzafBoz4ZLKDDEryoIMOtfyQDgC3CHRBpiWBTH9UvsHbNhfz45hx4aLbSH4Q4xl7vOFbKGY8188WNiw17hPp0VZQRjl7XtLjJHqcIRMeiNwoxqU7AZrB+u1BlkBH+WOsBhPQEmloVCO5Makg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634343513; bh=8VC9fL41kGKYiVWJ4qbu4yLCc/Z+uQA2d/KjOiDOovz=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Awx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B72 Wob48OoHf5gQAllCIckohfnIagSGCRY4c6N1VRmZ59aZTaLkNJueot2DgslGBxy7N4.WdZaAU8E1 eKeXUjicZpOC7f5HHGBevpLJt48RTlZrfakFlimg49tNsMF7HudFtE0P2nHZxeDvAXvB7kw1FICC bx_ViA4zyeEiaNUDMaXQo4UKTByGV3pbmtQfQnL5K6YCiR8zhlhx7BcSsR1tCX6.NUHUnJNTg0s1 3GBFKebzsRgJlGk7P9qSXwL0CH8uA90JjOhQFoTODsKO.Y_FlVEg1FQ068G3HtttSFTUR23yKh9I hP8u_saKL0LwitR74iEz7ahVu0yDrpmpRyauCQRJZ2n9AtFXj1OSeD.nGduK4qcJB4nr5bo3LOSE y5e360GTxCKpf1a8MO0RhAtgw.6gSKYvw5UFG8fhSGRM3LiWDhcrz7JD.Y79QE.KD7frs9CT0Qim s9o7Ap_mPtBQ9PTlEBv54hBk_cZP5_7GXFbzTqHIzFSRxQr31mNZ_vA-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 00:18:33 +0000 Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 023f3ed9d06c6effad4369b399f87aa5; Sat, 16 Oct 2021 00:18:29 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> Date: Sat, 16 Oct 2021 08:18:25 +0800 In-Reply-To: <83v91yiesj.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Oct 2021 16:43:56 +0300") Message-ID: <8735p1izzi.fsf@yahoo.com> 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: 636 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > This part doesn't look right to me: FACE_FOR_CHAR could potentially > yield a face with a different font, but the glyph codes in the glyph > string will reference the previous font, because > get_glyph_face_and_encoding was called before the face was changed. But now that I think of it, what if the original font has different metrics than the mouse face? In that case, shouldn't s->font be the original font and not the font of the mouse face? Thanks. > Also, why did you not follow the more cautious code of xterm.c: > FACE_FROM_ID can abort if the face is not in the face cache. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 02:09:43 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 06:09:43 +0000 Received: from localhost ([127.0.0.1]:40800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbct5-0002MS-8k for submit@debbugs.gnu.org; Sat, 16 Oct 2021 02:09:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbct1-0002ME-HE for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 02:09:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38938) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbcsw-0006Ap-5l; Sat, 16 Oct 2021 02:09:34 -0400 Received: from [87.69.77.57] (port=1542 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbcsv-0008Gi-Op; Sat, 16 Oct 2021 02:09:34 -0400 Date: Sat, 16 Oct 2021 09:09:34 +0300 Message-Id: <83k0idijq9.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <8735p1izzi.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 08:18:25 +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@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 08:18:25 +0800 > > Eli Zaretskii writes: > > > This part doesn't look right to me: FACE_FOR_CHAR could potentially > > yield a face with a different font, but the glyph codes in the glyph > > string will reference the previous font, because > > get_glyph_face_and_encoding was called before the face was changed. > > But now that I think of it, what if the original font has different > metrics than the mouse face? In that case, shouldn't s->font be the > original font and not the font of the mouse face? Thanks. I don't think I follow: what is "the original font" in this context? And when you say "shouldn't s->font be", do you mean what it should be before or after the processing in fill_glyph_string? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 02:16:37 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 06:16:37 +0000 Received: from localhost ([127.0.0.1]:40805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbczl-0002Ws-14 for submit@debbugs.gnu.org; Sat, 16 Oct 2021 02:16:37 -0400 Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:38565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbczi-0002Wb-VA for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 02:16:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634364989; bh=B73PJQsPGXcUvD1o7WzmiqxMBgk+JxC3d8sTIxF82dI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=gIKxOfzPf4UMw81psqatijQYRd8m3aI827vXfL1Bx8oKXyl9UazLRF7s0eRutxZ4qO2R44G7/6Ex2ij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7.ll9ya18xzp5N.km0.u6j.HpJjeIjd0uHsbF3dF6190RIvoUCKfWdzC Wp5bYe_7c4qbrd4unp2fuugGsve0XQ8IS6lTgESXpQBlL58Isqkskw.pNReBUrO7jNQAOHQmmbyC 8NSIfDZztyc9LGtvajX4Z4bb37vg_9nH0E4YPia3vG5RqIMT1L2qnwMtqJO3JB4Cfrav4bDsX6wG WLMIDI74ShXRBHzPUqCNQN_y0UGXijhh8EKMqmUc0SBtacs6CtCuhmtD0nhLkhIvYpvDNye6LYv0 yKzKPplkD5TxKatbEC9pR1AZbvkO1TI0YwqPbpxLZ2jdjx1dKM7Nwbh_CefaCgKbdMxoMdHVsitn qa33VfAYg6xtUIFnhnFNi4kjwh74RHhckY2FdE46C4LE5.ioNM7c0uLs30Sa4F8jBl.0IVFh_nDP 29ApvFAN9VBnbIPRJ.WkV5kpbFzYD0SVyCf7JqwImBtDhhd8qujE0iZwVp52z2auEEqNOSVZNd0Z D1TVjpQGSJmYVXRtsXeGeuhpQ59Gjx9mgei8yuiWZh2YPKLZsOIW8xhNasgsq52DbsZVpQRe.6pL LKpYYZ06NWqHVAsy4hPyVf1PZOxOBrIqogvuXOichJnsHPQ5ogdg.3NLF9dA1lVNh139mxez4MZh XOrT97i0Q1pgmb_DBNEfGzxha0KyBymLnVlXZd080rDm0OLffUyPgOVUoiX2IseRgOdP8H8fqv_m P.dFEe9r1RLzdCt32uzDBNz_PercL_IB9WCTuw7jnb_UMDfU3kpgIST7eBmJpW1MV.aprSwBAiMs gfuPscKmF9pGBBFQkl_DSnJ1ez5ARNZiPT8ke0K_n75.61pm0P_aUUd7im1tqKMsNCzhdA5koppq OonP1HXwGA6zThSwgQHD6HaZnEZd3TpN7.6wXeIwSRndVWmscu1em X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 06:16:29 +0000 Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 472754dbc1ca94c1d31d50e1e9c7aee5; Sat, 16 Oct 2021 06:16:22 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> Date: Sat, 16 Oct 2021 14:16:12 +0800 In-Reply-To: <83k0idijq9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 09:09:34 +0300") Message-ID: <87lf2th4ur.fsf@yahoo.com> 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: 446 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I don't think I follow: what is "the original font" in this context? > And when you say "shouldn't s->font be", do you mean what it should be > before or after the processing in fill_glyph_string? I meant what it should be after the processing, and by "the original font", I meant the font of the original face, that was used to calculate the metrics of the glyphs. Apologies for the confusion. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 02:28:13 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 06:28:13 +0000 Received: from localhost ([127.0.0.1]:40810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdAz-0002nP-4D for submit@debbugs.gnu.org; Sat, 16 Oct 2021 02:28:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdAx-0002nB-FG for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 02:28:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40464) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbdAs-0001zr-5e; Sat, 16 Oct 2021 02:28:06 -0400 Received: from [87.69.77.57] (port=2676 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbdAp-0003bf-Ml; Sat, 16 Oct 2021 02:28:06 -0400 Date: Sat, 16 Oct 2021 09:28:04 +0300 Message-Id: <83fst1iivf.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87lf2th4ur.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 14:16:12 +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@yahoo.com> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 14:16:12 +0800 > > Eli Zaretskii writes: > > > I don't think I follow: what is "the original font" in this context? > > And when you say "shouldn't s->font be", do you mean what it should be > > before or after the processing in fill_glyph_string? > > I meant what it should be after the processing, and by "the original > font", I meant the font of the original face, that was used to calculate > the metrics of the glyphs. FACE_FOR_CHAR will get you the face with the correct font, and calling get_glyph_face_and_encoding after that will produce the glyph codes from that font. So that's exactly why I commented why your additional code must be before the loop that produces the glyph codes (inside get_glyph_face_and_encoding). From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 02:40:16 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 06:40:16 +0000 Received: from localhost ([127.0.0.1]:40816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdMe-000357-8s for submit@debbugs.gnu.org; Sat, 16 Oct 2021 02:40:16 -0400 Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]:33316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdMb-00034o-8O for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 02:40:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634366407; bh=vaNV6YZvzwQBsGKyox4I+cXFgZmD4sAR+Bi3pFP0jiI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=RYbv/Q8EvMnADDmVmGLqT2ibePGxtQb8LysgxaC1ZpuBlrlfd6DkZWkWfE2EDKMwKDXRznKfyeImk5HrS6gfBCY7YVrc38M8zHWSYssXs3GfVizjSl5U0FBqBk2NIexWyOh/yI7cH9KqL2IbDYPl0J0TxJc4DBriDW9b6b7DVhL4s505ABKKTKr6tw/FGSBdgw5MiLKHU7M5smBSdO/G4RCxIPsEk8s2V5fDz5idMi/5iYy325RAKknYJAES3yUHAgulnCVAjSvk8tPA1e5Fr/KM+wQQ2BVXLROiykuXaHRlFaRwab8aZL8w7EtpehBbHGaOUS4WY1QouZZ/0ZF2ww== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634366407; bh=xwhNxBt1cu0L6ev5s05YdRkGeKVCGD3z4b2W+T2Aeox=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=LV/ELdw44TCED0qYXmG7KQ6UP5ggCnmCtcqyPtzDGHO8f2k2FOvXDCLwkEj1imyvCWgOzdNTyG5e7+sn3RMl/by+xyhhFzJKcquYOMJeuwmYSPUz7Q0WriK9HdCLomK0KJjLWmEDvufZokZt0FhBFLzipxxlqVs3Wg/+Tb9Jus9tIvyqDxG++w+6/gRF5Tv0aZ29gEz52oUKxbZPVt26ARZDRg76GWJWRnfVXXTEI8c723TMwqtYXXPY8TBKABfIehTp4I00L7qwVukTADNsoZ7KYfQkxq2LwvPO2D/IWuM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Cn13PsbKV3nNQPRmRS.V2p8w7 2daINWfo9VvToHmphI_f8qOpzQVDJq1eQygwU24utVsCKXv.bJ2C6se2.Bo9txSNfjyBBY7mpsFj uRxubQMyLv7rUvNEdili3rAowvPjrFd_..Q4TpBEb8kXAHTfshi.nzY1Ivh6dxpAr19QIpFKaFAN ePYPXmsSdOoZ5Hw7EE2k71yTY98GUrEISkD2MWKRRQ3V.eZeRBJU- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 06:40:07 +0000 Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 38796a9720ce2ba35a4900b8d5c59d81; Sat, 16 Oct 2021 06:40:02 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> Date: Sat, 16 Oct 2021 14:39:58 +0800 In-Reply-To: <83fst1iivf.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 09:28:04 +0300") Message-ID: <87y26tfp6p.fsf@yahoo.com> 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: 2492 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> I meant what it should be after the processing, and by "the original >> font", I meant the font of the original face, that was used to calculate >> the metrics of the glyphs. > FACE_FOR_CHAR will get you the face with the correct font, and calling > get_glyph_face_and_encoding after that will produce the glyph codes > from that font. So that's exactly why I commented why your additional > code must be before the loop that produces the glyph codes (inside > get_glyph_face_and_encoding). We might be misunderstanding something: I'm asking whether to arrange fill_glyph_string like such: /* The loop with get_glyph_face_and_encoding is above this comment */ s->font = s->face->font; if (s->hl == DRAW_MOUSE_FACE || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); struct face *face = FACE_FROM_ID (s->f, hlinfo->mouse_face_face_id); s->face = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil)); } Or like such: /* get_glyph_face_and_encoding is modified to produce glyphs with the mouse face in the loop here. */ while (glyph < last && glyph->type == CHAR_GLYPH && glyph->voffset == voffset /* Same face id implies same font, nowadays. */ && glyph->face_id == face_id && glyph->glyph_not_available_p == glyph_not_available_p) { s->face = get_glyph_face_and_encoding (s->f, glyph, s->char2b + s->nchars, /* This argument controls whether or not get_glyph_face_and_encoding uses the mouse face */ (s->hl == DRAW_MOUSE_FACE || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))); ++s->nchars; eassert (s->nchars <= end - start); s->width += glyph->pixel_width; if (glyph++->padding_p != s->padding_p) break; } s->font = s->face->font; I think the first situation will work better, because we want the mouse face to be drawn with the font that the regular face is under, not the font of the mouse face. This is how the old code in *term.c used to behave, and prevents the text from being drawn with a font (font, not face) that has metrics different from that of the mouse face's font. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 03:01:03 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 07:01:03 +0000 Received: from localhost ([127.0.0.1]:40834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdgl-0003dL-2v for submit@debbugs.gnu.org; Sat, 16 Oct 2021 03:01:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdgh-0003cj-TF for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 03:01:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41652) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbdga-0001JX-TS; Sat, 16 Oct 2021 03:00:53 -0400 Received: from [87.69.77.57] (port=4664 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbdgH-0000Av-Vl; Sat, 16 Oct 2021 03:00:46 -0400 Date: Sat, 16 Oct 2021 10:00:34 +0300 Message-Id: <83ee8lihd9.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87y26tfp6p.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 14:39: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@yahoo.com> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 14:39:58 +0800 > > I think the first situation will work better, because we want the mouse > face to be drawn with the font that the regular face is under, not the > font of the mouse face. I don't understand: if the mouse-face changes the font, you want to ignore that? why does that make sense? And mouse-face is defined for ASCII font only anyway, which is why the code calls FACE_FOR_CHAR. You want to ignore the font that this call produces? > This is how the old code in *term.c used to > behave, and prevents the text from being drawn with a font (font, not > face) that has metrics different from that of the mouse face's font. A face includes the font, so I don't understand why you want to separate them, and how. As for the old code: are you sure that's not a bug, part of the same subtle issue you are trying to fix? Btw, I'm not sure we need move the face selection into get_glyph_face_and_encoding, I think it should be left outside. That selection needs to be done only once, whereas get_glyph_face_and_encoding is called in a loop. You just should move the face determination before the loop, and momentarily change glyph->face to the selected face and back around the call to get_glyph_face_and_encoding. Maybe I'm wrong (it won't be the first time), but in that case please produce an example of a situation where my opinion produces incorrect results, so I could study it and find what I am missing now. Or maybe you could describe in more detail what you discovered about the artifacts I reported, which led you to these changes, because perhaps I don't have a clear idea about what exactly are you trying to fix here. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 03:13:42 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 07:13:42 +0000 Received: from localhost ([127.0.0.1]:40854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdsz-0003vj-4K for submit@debbugs.gnu.org; Sat, 16 Oct 2021 03:13:42 -0400 Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:42258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbdsu-0003vQ-6J for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 03:13:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634368410; bh=1G8lf0qhLLF7ybKeQMSyNK/dBokYPjsQ6rPdGnJxFpA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=niQjWL2sK3O9puDMDgpeCPSiDOhWRcLkZF1Hsuv+vMe16KvgiETZrZaTT4hD26frQZ4fbhUtNnInbGjNlvacXuN0C8xwlpV+ouXgTp4rbc4SPkTgx5TF/g99Hv6MOBi57RpML4pbqe90IfBvpxPnRG+OkXS5/fWaAn3iFX8Fp0ED7PcBcoEXRzdWRE9FDBJ0NRDz7uQSoWjGnjpClWhbrq2lIklMdccuJYey48CpS8JXrjyGcI0sLQmSUthF14h3i0odrEeFcHI+2G0Rx6sUcYAhC/FaSSkc5ubZOaDW24jt51q4GIzF1whUTy/ZuvbfW1ZbyX9Qd5fEzRfIHPf3hw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634368410; bh=lTunqyzA8mXmHCpwwBjkDp+StgTrppwl/05PioOJI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K4crCfd.ag_YXH7EFtlPgCbFJbtE5G88aj3Dy ujqtGn5U3Tu1VBPXgkCrRmOiKgE7dQVt24Hm.iCod48zvMehElC1kJdEjBU7pgEZPg.wEvKHwmK4 G5WuYH1CuCd1nJN6wZuFYgT3MftJhrWHTo2vWCafBDNFg9m5PmzJN.E96H9AUZjEKsG7tusJSotd DcLOG2rx6UuFevAJrZSl4W3c_3ZpGSXOaOLoPIde_iOGVE4ZVtmeGLQzHC6gutPfhvuGYPcATCRk AwKkOMmRRI_oBHOnB1xKaw76pkFff.N4kyLnYQobF.zC0idX4kPZ8kIS3HH82i_0SH6N7VVbR1yy S0a06HEv1fbZSf90e3B2cOthBqXqWy3GNWoeD8g76V5oQCR1_B7gkjeExupg4tlSLyxRNDLKwQXX X9BEFe9QxUivZhhS7mklOfAM8v2lS0LquN8MgkYtRB.sJ.8jgs7b3Vq3o0Eh3AvYO8ZIeipO.Ihi s6AQuHw8SZ1kH20Hj05joAjDtC09fJRMP604ou0uURd_KjEy7IGCgbw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 07:13:30 +0000 Received: by kubenode512.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 3cbecdceb4da541bca71c1aba1425805; Sat, 16 Oct 2021 07:13:27 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> Date: Sat, 16 Oct 2021 15:13:18 +0800 In-Reply-To: <83ee8lihd9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 10:00:34 +0300") Message-ID: <87lf2tfnn5.fsf@yahoo.com> 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: 913 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I don't understand: if the mouse-face changes the font, you want to > ignore that? why does that make sense? > > And mouse-face is defined for ASCII font only anyway, which is why the > code calls FACE_FOR_CHAR. You want to ignore the font that this call > produces? Yes, precisely. > A face includes the font, so I don't understand why you want to > separate them, and how. > > As for the old code: are you sure that's not a bug, part of the same > subtle issue you are trying to fix? I'm reasonably sure. Under the old code in *term, moving the mouse over the entry for `glyphless-char' in list-faces-display results in nothing, while under the new code (where s->font == s->face->font even under mouse face) the section under mouse face overlaps with its surroundings and is otherwise glitchy, because the mouse face's font is larger than the original face's font. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 03:26:58 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 07:26:58 +0000 Received: from localhost ([127.0.0.1]:40865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbe5p-0004FB-TR for submit@debbugs.gnu.org; Sat, 16 Oct 2021 03:26:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbe5n-0004Ey-OD for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 03:26:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42204) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbe5h-0006jT-WC; Sat, 16 Oct 2021 03:26:50 -0400 Received: from [87.69.77.57] (port=2312 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbe5h-0002qW-JZ; Sat, 16 Oct 2021 03:26:49 -0400 Date: Sat, 16 Oct 2021 10:26:51 +0300 Message-Id: <838rytig5g.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87lf2tfnn5.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 15:13:18 +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@yahoo.com> <878rzbd1w5.fsf@yahoo.com> <83wnmgkmok.fsf@gnu.org> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 15:13:18 +0800 > > Eli Zaretskii writes: > > > I don't understand: if the mouse-face changes the font, you want to > > ignore that? why does that make sense? > > > > And mouse-face is defined for ASCII font only anyway, which is why the > > code calls FACE_FOR_CHAR. You want to ignore the font that this call > > produces? > > Yes, precisely. > > > A face includes the font, so I don't understand why you want to > > separate them, and how. > > > > As for the old code: are you sure that's not a bug, part of the same > > subtle issue you are trying to fix? > > I'm reasonably sure. Under the old code in *term, moving the mouse over > the entry for `glyphless-char' in list-faces-display results in nothing, > while under the new code (where s->font == s->face->font even under > mouse face) the section under mouse face overlaps with its surroundings > and is otherwise glitchy, because the mouse face's font is larger than > the original face's font. In the examples I used for testing the size of the font was the same, so I'm no longer sure we are talking about the same thing. I also asked to describe what exactly you found that causes the artifacts I described when I installed the previous patch -- could you please provide that description? Because I'm no longer sure I understand what is the problem with the existing code you are trying to fix now. AFAIU, the issue is with displaying the cursor inside mouse-face, and that involves redrawing the character on which the cursor is displayed, so that must use the same font as the one we used to display the character itself, and use the same font. But mouse-face's font is not necessarily appropriate for every character shown in that face. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 03:52:48 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 07:52:48 +0000 Received: from localhost ([127.0.0.1]:40911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbeUq-00074t-9I for submit@debbugs.gnu.org; Sat, 16 Oct 2021 03:52:48 -0400 Received: from sonic312-25.consmr.mail.ne1.yahoo.com ([66.163.191.206]:43449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbeUn-00074c-QA for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 03:52:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634370760; bh=ch6eveYLBh4ZSgxBCHPBCfaXkRjJo31OHh9Sa1SiknE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=G+LkfUneTdhazskgFCoWQjhB2FkcdX3cenH/HYjytG2Ft7IwJZ570359GN6xH6vXrG01O9zwDmnrvFqmis9/8au4Zu1yRPmtJDB8a6GDtKTMQOrIU6ssbOPubw8RSrXqDA+7BJuOWfl62k3oO3OOgTwwU3ac4ZnklEhYV0e0eqx5yOMkcc0zRsk/38+ZfizBMTpFU4vydQfrwDDf4sr7AVhxdzddzlvXiVapFBpf7FCYDib3INihgn9Pjp2GkQHVnTuJ5EEiLBhIt7xH3Z2hs+kE+LAoPoeITRft3+stJFX0RtS2k7Wj23sg+aCEsKvg7yVclAICea7sBIlNTRLoTA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634370760; bh=F8qg93oDJeK3YFhf/cj8Jys1+VxhuDhJ9xUpz1/zuGg=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=uaxqaT5fmvpmaeP/xqABKOXDbYlO2+FtpyCR/0vEKLJPQ5biq5um1esxoZRqsTk6XwiDGPIzBMNE1mCeoXdFu2Oe7g0JG/pLjP4jCR6E5PvDXtdU7rtXccvoH3ZaSdziAJjs3ChxHMYfFqt7GpiaYq4Sy5iJgDQOEWgMLDIFBTlByDoq33YpHG8AcvcKH3Ub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hGlRDe4dNW7odXJ9f_h2rAdBxbi3nlpbW6rNWfFwOpoVoG8riS_KBGguV5W5QkDm9o z8QMoGM9DHGHW5fNu_NtufvAlxD5ykmQICsBo4gkHo_mlRHfVYeGyMHMtfL6dECS4s_QnG.JUSlx Glgw5kEylHJAMFPxK_J6eTEsoYxduxzbibPuSZbO5H57dVJYmwDoMCUOzO03zmLLux6zafm48AcF SptEBcrYpVSSfN_QAldJNQQsTqsLwZbgPhN.HVciDpr_glb7PA_L7Tp6XJ04d0wdjFLMQ.kipNQM Qe26fmAUfMYooPwMTLVjn_Lx9EIA0GsTrLkKgghjmKPtyardBlWQT7p0- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 07:52:40 +0000 Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e0c12b4ea63aaa83cdec326f8f8e3970; Sat, 16 Oct 2021 07:52:32 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> Date: Sat, 16 Oct 2021 15:52:24 +0800 In-Reply-To: <838rytig5g.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 10:26:51 +0300") Message-ID: <874k9hfltz.fsf@yahoo.com> 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: 2105 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: larsi@gnus.org, 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> I'm reasonably sure. Under the old code in *term, moving the mouse over >> the entry for `glyphless-char' in list-faces-display results in nothing, >> while under the new code (where s->font == s->face->font even under >> mouse face) the section under mouse face overlaps with its surroundings >> and is otherwise glitchy, because the mouse face's font is larger than >> the original face's font. > In the examples I used for testing the size of the font was the same, > so I'm no longer sure we are talking about the same thing. Yes, this has gone off on some kind of tangent. We're discussing the repercussions of a proposed method of moving the mouse face selection into fill_XXX_glyph_string, instead of putting it in terminal specific code. > I also asked to describe what exactly you found that causes the > artifacts I described when I installed the previous patch -- could you > please provide that description? Because I'm no longer sure I > understand what is the problem with the existing code you are trying > to fix now. Okay. The first issue, with the cursor put on the first character "s", is caused by this snippet of xterm.c (in x_draw_glyph_string_foreground): /* 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 && s->first_glyph->left_box_line_p) x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; An identical snippet exists in w32term. This happens because s->face is not the mouse face when s->hl is DRAW_CURSOR and cursor_in_mouse_face_p, so it mistakenly assumes there is a box for s (when there is in fact no box), and adds the original face's vertical box width to x. (Seeing this issue, you proposed to also move mouse face selection to draw_glyphs, and I proposed to move it to fill_XXX_glyph_string, leading to the above tangent about the semantics of s->font.) The second issue was caused by testing for "start <=" end instead of "start < end" in get_cursor_offset_for_mouse_face. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 06:11:10 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 10:11:10 +0000 Received: from localhost ([127.0.0.1]:40969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbgej-00023t-P0 for submit@debbugs.gnu.org; Sat, 16 Oct 2021 06:11:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbgee-00023M-JQ for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 06:11:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44618) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbgeZ-00025y-Dx; Sat, 16 Oct 2021 06:10:59 -0400 Received: from [87.69.77.57] (port=4853 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbgeZ-0007Kr-15; Sat, 16 Oct 2021 06:10:59 -0400 Date: Sat, 16 Oct 2021 13:10:59 +0300 Message-Id: <83wnmdgtzg.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <874k9hfltz.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 15:52: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@yahoo.com> <878ryvnain.fsf@yahoo.com> <83mtnbltyp.fsf@gnu.org> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: larsi@gnus.org, 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 15:52:24 +0800 > > Eli Zaretskii writes: > > >> I'm reasonably sure. Under the old code in *term, moving the mouse over > >> the entry for `glyphless-char' in list-faces-display results in nothing, > >> while under the new code (where s->font == s->face->font even under > >> mouse face) the section under mouse face overlaps with its surroundings > >> and is otherwise glitchy, because the mouse face's font is larger than > >> the original face's font. > > > In the examples I used for testing the size of the font was the same, > > so I'm no longer sure we are talking about the same thing. > > Yes, this has gone off on some kind of tangent. I don't think it's a tangent, see below. > Okay. The first issue, with the cursor put on the first character "s", > is caused by this snippet of xterm.c (in x_draw_glyph_string_foreground): > > /* 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 > && s->first_glyph->left_box_line_p) > x = s->x + max (s->face->box_vertical_line_width, 0); > else > x = s->x; > > An identical snippet exists in w32term. > > This happens because s->face is not the mouse face when s->hl is > DRAW_CURSOR and cursor_in_mouse_face_p, so it mistakenly assumes there > is a box for s (when there is in fact no box), and adds the original > face's vertical box width to x. So you are saying that s->hl can only be either DRAW_CURSOR or DRAW_MOUSE_FACE, whereas we need both? If so, this matches what I thought you were trying to solve. So what happens here is that s->face is computed from the face of the glyphs which "belong" to the glyph string s. That face comes from the glyph matrix which holds the glyphs. That face was computed by redisplay_window using FACE_FOR_CHAR, see get_next_display_element, so it's the face at the character's buffer position adjusted for the font suitable for the character at the cursor. Now you want to display that same character, but with the mouse-face. FACE_FROM_ID gives you that face, but it is for ASCII characters. So you call FACE_FOR_CHAR again, to obtain the mouse face adjusted for the font suitable for displaying the character at the cursor. The above sounds correct to me, so I don't understand why you want to ignore the font of the face produced by FACE_FOR_CHAR. What am I missing? > (Seeing this issue, you proposed to also move mouse face selection to > draw_glyphs, and I proposed to move it to fill_XXX_glyph_string, leading > to the above tangent about the semantics of s->font.) Yes. Btw, it would probably be cleaner to add an extra argument to get_glyph_face_and_encoding, but make that argument be a pointer to 'struct face', not just an indication of which face to use. > The second issue was caused by testing for "start <=" end instead of > "start < end" in get_cursor_offset_for_mouse_face. What was that second issue about? why did you need to change the inequality? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 08:13:13 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 12:13:13 +0000 Received: from localhost ([127.0.0.1]:41087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbiYq-0007QX-NQ for submit@debbugs.gnu.org; Sat, 16 Oct 2021 08:13:12 -0400 Received: from sonic313-56.consmr.mail.ne1.yahoo.com ([66.163.185.31]:42609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbiYp-0007QL-Cw for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 08:13:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634386386; bh=v6i/+vbvAJCQ3cLrmEfLt+Ui0i1JqMwzdJUobMyDdJ0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=FZ5ZkWZ2kGX1289+Q2h9+LATq7nve2kZahR9czJnLMSockbqDBPcuo0Dr6U7K/nmbO1yV+7ngZW0x62HMWHd6hkqxcgHoRLmB33oAl052Hz2gc+gucj7k4NLMijDYiShBHbbiMb3eTpUkiI6Dx1FnnB3OEBAyE7N30chlqhPwlPZL8PZHQBG91NXI1Ei/hJ920ztwL2XhX3sqetURiekxudp+rett0cgHXru4P9fE/WdeGMCWTcllBUMPrl3DKeJHjWGbrHDdv/RytkqVjcN++YlahxLyKu7/PTsDBMMfnBddhb3X2oYwtV0AA6C9uU1fcep7Oqslkdn4mCfKz9OOQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634386386; bh=X4f3QO/wcRoMM/ccyLErEnsS6nRj9qDD2L79a0MCsWb=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=s7cEnU/HEJSpjM1o+Dhuxin2QdbwO/3a8SsqjQVScfjwQtOgWpAyyrkXijMGd7ALvavdLRC9fiy7A2VUlX73atJXqU+KzM6W1LljvtSTcUd0GOS46R/TiDIyEwxNqeIi4fIlb3mNSlhYMj86CcCw8DdIMGpt9Iar0pTuhPFhlguc3mQxo1dicn2pzcxoWP5eOmt2xCp+Q/DlXq0qahxpjqwHlcAcKnxXVzoX8aK5///aeL9vwCJPN9yZi4ipN3MtbG4+GGTW3xYDW4X2EcBlYwuElBs18OJddGwMSlwZe23+LYqMVYJytzjwLQeGsHOdPWtmeeg1JL0uFnatniZHoA== X-YMail-OSG: trCwHsgVM1k04U4T9mGnMHLaNUcBrsft10uVoEI03XkM.Qt_7AT.slwPJeiWl7V lBr3ZK2r_QEAoEbvAjVNr9rDNo9wgAro8z.dQ1XniZZjCL8gAXJhnGgrerF7XNLQeZKqVSM7x50E IHQhqLMLakzaWh8YCMgfR1Z6GLK9r7rCdU8onklMJYr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K5xxH_D3XKofc5j9Mk- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 12:13:06 +0000 Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 7b9123133f4cce2c454b463ba92fc483; Sat, 16 Oct 2021 12:12:58 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> Date: Sat, 16 Oct 2021 20:12:55 +0800 In-Reply-To: <83wnmdgtzg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 13:10:59 +0300") Message-ID: <87lf2tdv7c.fsf@yahoo.com> 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: 1983 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > So what happens here is that s->face is computed from the face of the > glyphs which "belong" to the glyph string s. That face comes from the > glyph matrix which holds the glyphs. That face was computed by > redisplay_window using FACE_FOR_CHAR, see get_next_display_element, so > it's the face at the character's buffer position adjusted for the font > suitable for the character at the cursor. Now you want to display > that same character, but with the mouse-face. FACE_FROM_ID gives you > that face, but it is for ASCII characters. So you call FACE_FOR_CHAR > again, to obtain the mouse face adjusted for the font suitable for > displaying the character at the cursor. > > The above sounds correct to me, so I don't understand why you want to > ignore the font of the face produced by FACE_FOR_CHAR. What am I > missing? The problem occurs when (adjusted_mouse_face)->font has different metrics from the font originally used to display each glyph. (For instance, if mouse face is `highlight' but the original face was `custom-group-tag', which is variable pitch and has a much larger font size than `highlight') In this case, the text will be drawn with the wrong font for its existing metrics! If the mouse face has larger dimensions than the original face, it will extend past the boundaries of the original text, and if they are smaller, then the text will not be enough to fill the original text. And regardless of the relative dimensions of either faces, cursor position will be even more incorrect. > Yes. Btw, it would probably be cleaner to add an extra argument to > get_glyph_face_and_encoding, but make that argument be a pointer to > 'struct face', not just an indication of which face to use. Noted, thanks. > What was that second issue about? why did you need to change the > inequality? get_cursor_offset_for_mouse_face was including the glyph under the cursor in its offset calculations, which is invalid. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 08:26:31 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 12:26:31 +0000 Received: from localhost ([127.0.0.1]:41096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbilj-0007lT-2E for submit@debbugs.gnu.org; Sat, 16 Oct 2021 08:26:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbilg-0007lC-Ij for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 08:26:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47146) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbila-00042q-HR; Sat, 16 Oct 2021 08:26:23 -0400 Received: from [87.69.77.57] (port=1379 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbil9-0005z6-8w; Sat, 16 Oct 2021 08:26:19 -0400 Date: Sat, 16 Oct 2021 15:25:56 +0300 Message-Id: <83o87pgnqj.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87lf2tdv7c.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 20:12: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@yahoo.com> <87mtnblt35.fsf@yahoo.com> <83ilxzlsck.fsf@gnu.org> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 20:12:55 +0800 > > The problem occurs when (adjusted_mouse_face)->font has different > metrics from the font originally used to display each glyph. > > (For instance, if mouse face is `highlight' but the original face was > `custom-group-tag', which is variable pitch and has a much larger font > size than `highlight') That's a separate problem, which exists in the current code as well, doesn't it? The only solution to that is to merge the mouse-face with the original face, ignoring the attributes of mouse-face that affect the text size, as documented in the ELisp manual. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 08:37:06 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 12:37:06 +0000 Received: from localhost ([127.0.0.1]:41106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbivy-00083V-9Y for submit@debbugs.gnu.org; Sat, 16 Oct 2021 08:37:06 -0400 Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:37876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbivw-00082y-IL for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 08:37:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634387818; bh=kPCEEsx23iItonSfPTKY36zull/uFO4r4SWC1Ekcta8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=qz7+F2GyePb9Pf1OFqGuAAQ44RN6dRaLOz8J6YWXOeKFj6bCkpJuCuK2GG0mGHHyi5PpxF8M8dEA9cQy5N5VAoNqPCubz+oYPUeDGRfACapuqRgsPjrJoTqFpjfM7OoKXraH6VAmI5RsGiZCDtDrf1jeYhBb18bGVMwi/LTEy8vNa+VApXFvNSjnsqVMBB//Ia34BzuamD6mFFRHGmCdlZIRRRKeF7T3Z8ofEIFnE7lOIiW/WzMT4RGLXVy1HLaXFTDySTA6q7B09SGeph1z22O/tdEPIew/OAdzMgYdrG5H40bpkDkFSoWk4xU5G70BeDlzxx+mTlsJtHYHi/GBMQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634387818; bh=xYJ5Jw7B7kO3zuzCAPDHqhs1zx+Jk3tsL+E8EW05HNH=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Vu3K9IQn0cOsvmQ8cfleDqf7Fy8S2r9uP/x3oESms/R7IgiRlJW8cp/RsDdCc8gtWX8PCXSv42ANcVU/IvdPf1zgUbQbBGT0HfoKDqs/YGIQQWVU20obqVkMFWklwpJ1YOVo1Irh6h25i77eURBotUgmbRxwFVJqb/ZdcUct+4yBlJafSejr5XftSMJsmtZaGhuTLWQPLhBZVuRCZvZtCaXMFizU0B103PQwAdTgQkZtQN/twyTQ5CEr8N16wW8UFeY8DIVz4W/SKHy7aPHJAcHtuaXiEg4ASzocO5TxMAP3kaqLLZFg9SO9OhUjW/et820WF2QKdrcsroYdraJuUg== X-YMail-OSG: DvnzsZsVM1lwzYThe266_dUy4e3DRO2k0ER79GzteXi2ug1xRp6VvJOny3tm9IY DBug0W5M7Bgrs8.1lvlb0iyElDT72tZXI86DcgGfxcflJSafnHTik4PbrTZ96uEU4pWzSaYYEneb QmuRSD_WL_fRnHHdG7WjNQMuxsvIPR0P8tny2othKkrdlRnSLsXPuwb5MvI8cQ92gyqGvp2RIFKA Z.rLhXGRLmIkHvXqh3nDHqgyUIUbzjxfgeRtzvoDSJyGMfFM_iVWcf3H.ff4Pcbk_sqK7npp7hkW wCLyg5c6mhDpwnU6vhOkOBBr01aTd25eAqTEe4b1UFdOVQFtuIX1w.3NzNjV96GJWTTDrPXEllR1 aWOY7qWA8OvYqBBfZ0zfatpY04FTDtZI5GAZxdohfPXWDFZr0ELv.no4_5.jLwFYam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AlqjV pNCi_0E1GV1OZW6I8Dcw9DQkcrnBD91zF97hOzc7KPTdpHnOqxojK5vfR.7t9eqrnjI_DYtf7Nyd cmSLsqGS6ZS2qJemccQzkp.JJUfRyryhlzJF0OId311PnNbeqreXIci58qmymZXjqlxjY2TEiABz 2oQOPYQw0gnJQThUz9b5afCCJMFgMFPgV.1U34C6_U7zg_ABivPDH0.zPBUxu2WYjrajxkC6jazO timOo7PvJpPI9sJkpasKtOURyNbuzG37UXP8gFoFsFo6RktGPsoutf7tYBt.gninzYALvgT9tRFJ FAgn4_UfYkeux4OOZ1dqw5zi.16k_Ce0Fa6bk9U5pPtygVBEvzuVcawfi14eUngRJlGz2Zuymmhb zS.cYwvKUgBmGW6hoFfySfRMGzWYAPSGjKuR0DxdoHJbJ_l46KmvKNplnO1L1LFY9f1tdbRd4d2K n17DXsyevudc_gGxgLNVzFL.aAnlvCftZBoSgbb3ccwDhUVHagAtN1VAZwle3VpRaH2IaiE3XvI1 U42jgJt6eXEo6UDw.KVzMqliiJlHRauxc1dazhrZ.7TMCYsBe3nY5dCtkNcG7tia8uMt2nWQrixB DQsmxvXwhNg_WG8P2FZ0eeGpfZ65NnLTH6HuC5o0xpP9jwGYS4XjgzjS1Im31SzHx1KnQClIoQu3 Lms82PyUbKgWkRZFTZQGEeo8aeUyBQ1Lqt3.sBasOITfmh.bVK6gDp.fl9rufUgqUURDr8w8IUg4 09c4CCpgrCmA7czqgCBGHiE.LWAZnT3mcODoerMaehXNFmndfCJ4ysAAPDw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 12:36:58 +0000 Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2161799906e1578d4b5790247a1c38e8; Sat, 16 Oct 2021 12:36:52 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> Date: Sat, 16 Oct 2021 20:36:43 +0800 In-Reply-To: <83o87pgnqj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 15:25:56 +0300") Message-ID: <87fst1du3o.fsf@yahoo.com> 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: 524 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > That's a separate problem, which exists in the current code as well, > doesn't it? It doesn't, because s->font isn't updated (while s->face is) in the current code, which makes everything work properly. > The only solution to that is to merge the mouse-face with the original > face, ignoring the attributes of mouse-face that affect the text size, > as documented in the ELisp manual. Would this be easy to do? If so, could you explain where to begin implementing this? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 08:45:57 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 12:45:57 +0000 Received: from localhost ([127.0.0.1]:41110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbj4X-0008Ga-7M for submit@debbugs.gnu.org; Sat, 16 Oct 2021 08:45:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbj4V-0008GL-M0 for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 08:45:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48030) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbj4K-0002tF-GU; Sat, 16 Oct 2021 08:45:45 -0400 Received: from [87.69.77.57] (port=2665 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbj46-0004pt-Kn; Sat, 16 Oct 2021 08:45:43 -0400 Date: Sat, 16 Oct 2021 15:45:31 +0300 Message-Id: <83mtn9gmtw.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87fst1du3o.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 20:36:43 +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@yahoo.com> <877defls2w.fsf@yahoo.com> <83fst3lrwr.fsf@gnu.org> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 20:36:43 +0800 > > Eli Zaretskii writes: > > > That's a separate problem, which exists in the current code as well, > > doesn't it? > > It doesn't, because s->font isn't updated (while s->face is) in the > current code, which makes everything work properly. Then maybe the simplest solution would be to do the same. > > The only solution to that is to merge the mouse-face with the original > > face, ignoring the attributes of mouse-face that affect the text size, > > as documented in the ELisp manual. > > Would this be easy to do? If so, could you explain where to begin > implementing this? Thanks. See merge_face_vectors. But perhaps ignoring the font of what FACE_FOR_CHAR produces has the same effect, but cheaper. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 09:18:26 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 13:18:26 +0000 Received: from localhost ([127.0.0.1]:41150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbjZx-0002oo-Bz for submit@debbugs.gnu.org; Sat, 16 Oct 2021 09:18:26 -0400 Received: from sonic313-56.consmr.mail.ne1.yahoo.com ([66.163.185.31]:36515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbjZu-0002oZ-Q8 for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 09:18:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634390296; bh=aF8C4jPX80d9pa4iOT640uWN801nCLKSjB9wsIm63yo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=tvfvuTnIg6i9t8uarjdAry3OG/3we5fpObRhVtcnup2uGngVWjEcsK1XL1tTu7zbSzhUWrZnCUHiOA2up9tQxtaS3cJZLLY/TG6CuyXjZK488ErPIYkUlE3l7Pt59Jw3QfOP+iv0k7MT7pcoVO9CedGBOuBBdjkI8deMqoliyZs8V7miNGOdm8hNiTVp/w+6Lr9iyQP6sRqu2bXloPNV/FKidwS8n0jP3uL8HJXhjpqSChmutc20LrfWLclRV81yJcqufUrMhIfBtchFRrG/Zr9h+kmSay/MsUPnP1PBuJyGgy+3OX1jN8aVT3kO4YogdP3kv6AU3Vf5W5n7tip3ug== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634390296; bh=025ty5JEn7z9mg8pmo6A7Hevt5ts1QcJJXj9dbgXw++=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Oivm4h6bgBzNPUEmEV9ltHv+V9jDLIKIi8K64sj7byqAQPaqkibthrGDldG/IWr5IFewtlBKEtxtMESffNFJ0O+EiUvASvv5cw8QCkH4K++tFFg7bDweTgMSOWkqdoi9Rv7RxBbur6u8gRcsYMc41lwHZ6wH8UsF3qW13Bj8cyk5wX7WwYhKAY4CnltEgE/MK8nMZsF3wKH2K4hw/5WeCE/YGvAAQs91n2VXwOTwiZramxHiO+YIJ2mWqxXxU/8QA3/Ey4x6QjGbYYW4Ab+HRPbLVgaLPBXoF3QGxkU6TkYK2BvcV7C1fjv6mQcO4up6KQq0T9+ZkpH5OqaeCjvFlA== X-YMail-OSG: lCpG0L4VM1lTeB9stLI5HCmyO1gA9SmEKAr4EueAE6QI0KDHnjcongb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Jj7.WoLPjNLuMdFXu7IGCEGKOxAIudmBXipoWBzl734qUZ58piOuCBvgb5fT0kXk4RXHDpu7 .RRNZ64cnX8DJlLdNCV4Mg2kJN_9LCS8fj1pvjfhL9R.ZE0UqQHbNEE2Z0dna X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Oct 2021 13:18:16 +0000 Received: by kubenode514.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 46b274f5200f73177e40fbcec756fcc8; Sat, 16 Oct 2021 13:18:11 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> <83mtn9gmtw.fsf@gnu.org> Date: Sat, 16 Oct 2021 21:18:02 +0800 In-Reply-To: <83mtn9gmtw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 15:45:31 +0300") Message-ID: <877dedds6t.fsf@yahoo.com> 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: 13342 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Then maybe the simplest solution would be to do the same. Yes, I tend to think the same way. Do the attached changes make sense to you? Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-minor-issues-with-text-display-when-cursor-is-in.patch >From 92165a34d29af55723e9a141218f4f5325330351 Mon Sep 17 00:00:00 2001 From: Po Lu 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. (fill_composite_glyph_string) (fill_gstring_glyph_string) (fill_glyphless_glyph_string) (fill_glyph_string) (fill_image_glyph_string) (fill_xwidget_glyph_string) (fill_stretch_glyph_string): Set s->face to mouse face whenever appropriate. (set_glyph_string_background_width): Update background width and s->width to take into account differing :box properties of the mouse face, when producing strings for the cursor. (erase_phys_cursor): Redraw mouse face when erasing a cursor on top of the mouse face. * src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under mouse face because redisplay now does that for us. * src/w32term.c (w32_set_mouse_face_gc): Likewise. --- src/w32term.c | 16 ----- src/xdisp.c | 162 ++++++++++++++++++++++++++++++++++++++++++++------ src/xterm.c | 16 ----- 3 files changed, 144 insertions(+), 50 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index 9cf250cd73..07a5cd3564 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -954,22 +954,6 @@ w32_set_cursor_gc (struct glyph_string *s) static void w32_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - /* If font in this face is same as S->font, use it. */ if (s->font == s->face->font) s->gc = s->face->gc; diff --git a/src/xdisp.c b/src/xdisp.c index 012c2ad8bf..876a68d99c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28128,6 +28128,19 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, s->font = s->face->font; } + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + int c = COMPOSITION_GLYPH (s->cmp, 0); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + + s->face = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, s->face, c, -1, Qnil)); + } + /* All glyph strings for the same composition has the same width, i.e. the width set for the first component of the composition. */ s->width = s->first_glyph->pixel_width; @@ -28164,7 +28177,16 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, s->cmp_id = glyph->u.cmp.id; s->cmp_from = glyph->slice.cmp.from; s->cmp_to = glyph->slice.cmp.to + 1; - s->face = FACE_FROM_ID (s->f, face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + } + else + s->face = FACE_FROM_ID (s->f, face_id); lgstring = composition_gstring_from_id (s->cmp_id); s->font = XFONT_OBJECT (LGSTRING_FONT (lgstring)); /* The width of a composition glyph string is the sum of the @@ -28220,6 +28242,14 @@ fill_glyphless_glyph_string (struct glyph_string *s, int face_id, voffset = glyph->voffset; s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font ? s->face->font : FRAME_FONT (s->f); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + } s->nchars = 1; s->width = glyph->pixel_width; glyph++; @@ -28283,6 +28313,18 @@ fill_glyph_string (struct glyph_string *s, int face_id, s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + s->face + = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, s->face, + s->first_glyph->u.ch, -1, Qnil)); + } + /* If the specified font could not be loaded, use the frame's font, but record the fact that we couldn't load it in S->font_not_found_p so that we can draw rectangles for the @@ -28312,6 +28354,14 @@ fill_image_glyph_string (struct glyph_string *s) s->slice = s->first_glyph->slice.img; s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + } s->width = s->first_glyph->pixel_width; /* Adjust base line for subscript/superscript text. */ @@ -28326,6 +28376,14 @@ fill_xwidget_glyph_string (struct glyph_string *s) eassert (s->first_glyph->type == XWIDGET_GLYPH); s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + } s->width = s->first_glyph->pixel_width; s->ybase += s->first_glyph->voffset; s->xwidget = s->first_glyph->u.xwidget; @@ -28351,6 +28409,14 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end) face_id = glyph->face_id; s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + } s->width = glyph->pixel_width; s->nchars = 1; voffset = glyph->voffset; @@ -28598,7 +28664,12 @@ right_overwriting (struct glyph_string *s) /* Set background width of glyph string S. START is the index of the first glyph following S. LAST_X is the right-most x-position + 1 - in the drawing area. */ + in the drawing area. + + If S's hl is DRAW_CURSOR, S->f is a window system frame, and the + cursor in S's window is currently under mouse face, s->width will + also be updated to take into account differing :box properties + between the original face and the mouse face. */ static void set_glyph_string_background_width (struct glyph_string *s, int start, int last_x) @@ -28620,7 +28691,67 @@ set_glyph_string_background_width (struct glyph_string *s, int start, int last_x if (s->extends_to_end_of_line_p) s->background_width = last_x - s->x + 1; else - s->background_width = s->width; + { + s->background_width = s->width; +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (s->f) + && s->hl == DRAW_CURSOR + && cursor_in_mouse_face_p (s->w)) + { + /* We will have to adjust the background width of the string + in this situation, because the glyph's pixel_width might + be inconsistent with the box of the mouse face, which + leads to an ugly over-wide cursor. */ + + struct glyph *g = s->first_glyph; + struct face *regular_face = FACE_FROM_ID (s->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 (!s->row->reversed_p) + { + struct image *img = IMAGE_FROM_ID (s->f, 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 (s->f, 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 from the + offset. */ + if (do_left_box_p) + s->background_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) + s->background_width -= max (0, regular_face->box_vertical_line_width); + /* Now add the line widths from the new face. */ + if (g->left_box_line_p) + s->background_width += max (0, s->face->box_vertical_line_width); + if (g->right_box_line_p) + s->background_width += max (0, s->face->box_vertical_line_width); + + /* s->width is probably worth adjusting here as well. */ + s->width = s->background_width; + } +#endif + } } @@ -31755,10 +31886,6 @@ 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; @@ -31829,13 +31956,16 @@ erase_phys_cursor (struct window *w) mouse_face_here_p = true; #ifdef HAVE_WINDOW_SYSTEM - /* Adjust the physical cursor's X coordinate if needed. The problem - solved by the code below is outlined in the comment above - 'get_cursor_offset_for_mouse_face'. */ - if (mouse_face_here_p) + /* Since erasing the phys cursor will probably lead to corruption of + the mouse face display if the glyph's pixel_width is not kept up + to date with the :box property of the mouse face, just redraw the + mouse face. */ + if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p) { - get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta); - w->phys_cursor.x += mouse_delta; + w->phys_cursor_on_p = false; + w->phys_cursor_type = NO_CURSOR; + show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE); + return; } #endif @@ -31874,10 +32004,6 @@ erase_phys_cursor (struct window *w) draw_phys_cursor_glyph (w, cursor_row, hl); mark_cursor_off: -#ifdef HAVE_WINDOW_SYSTEM - /* Restore the original cursor position. */ - w->phys_cursor.x = phys_x; -#endif w->phys_cursor_on_p = false; w->phys_cursor_type = NO_CURSOR; } @@ -36042,7 +36168,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 2b365929a1..0435ad341c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1573,22 +1573,6 @@ x_set_cursor_gc (struct glyph_string *s) static void x_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - if (s->font == s->face->font) s->gc = s->face->gc; else -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 09:46:54 2021 Received: (at 50660) by debbugs.gnu.org; 16 Oct 2021 13:46:54 +0000 Received: from localhost ([127.0.0.1]:41167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbk1W-0003TX-3s for submit@debbugs.gnu.org; Sat, 16 Oct 2021 09:46:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbk1T-0003TK-Kt for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 09:46:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49088) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbk1O-0002e5-3u; Sat, 16 Oct 2021 09:46:46 -0400 Received: from [87.69.77.57] (port=2719 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbk1L-0003GM-7i; Sat, 16 Oct 2021 09:46:45 -0400 Date: Sat, 16 Oct 2021 16:46:44 +0300 Message-Id: <83k0idgjzv.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <877dedds6t.fsf@yahoo.com> (message from Po Lu on Sat, 16 Oct 2021 21:18: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@yahoo.com> <87o87rkczt.fsf@yahoo.com> <83czo7lqrl.fsf@gnu.org> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> <83mtn9gmtw.fsf@gnu.org> <877dedds6t.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: 50660@debbugs.gnu.org > Date: Sat, 16 Oct 2021 21:18:02 +0800 > > > Then maybe the simplest solution would be to do the same. > > Yes, I tend to think the same way. Do the attached changes make sense > to you? Thanks. There are two minor issues still: 1) After producing the mouse face, you should call prepare_face_for_display. 2) The code you add in set_glyph_string_background_width is almost identical to what we already have inside the loop in get_cursor_offset_for_mouse_face, and I wonder whether we could have a function to be called from these two places. Other than that, I think this is fine, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 16 20:33:07 2021 Received: (at 50660) by debbugs.gnu.org; 17 Oct 2021 00:33:07 +0000 Received: from localhost ([127.0.0.1]:43276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbu6s-00073f-7h for submit@debbugs.gnu.org; Sat, 16 Oct 2021 20:33:07 -0400 Received: from sonic314-21.consmr.mail.ne1.yahoo.com ([66.163.189.147]:36359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbu6q-00073A-1D for 50660@debbugs.gnu.org; Sat, 16 Oct 2021 20:33:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634430778; bh=YAlRh6DCYeUx+34Tsqk3lwnsQD4r6DRu2qeiUdhxybU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=UuLSmOGdz31uRH6H1LBrok82ij5WfSCzzEQ6aN3QUzpFp+ps+dmOAT49mVzWtVHN7uyacQxl39DdDHOC5yfzEj/QyNo8qhWeSISY/8pn7YHKHgeMqgHz+4zwSkGyUE4VTmSPwriMihdPnsb1HCh01PxwMSPQmDXPEU3jBuoDKZO6FgpOcIbK4FOBDMELMZoCX+QGi6pCBVlrwKNPCV2u36r3Vh63a5k7jxhBjvQbuq4KcRIG30c1aBabnMB7LT22mKCnMUXQ0GWCd/cbHGOm9YJLm682uRncUEt9v/UgHZO3M6MyeOwOtzW4SQ+NP9q5lUPazGx5dx5dmG+8WwEz/w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634430778; bh=maBQRhYw8SBWI7unb01axXAz4S+QnjUqdj8qffDJHDw=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=TlM7zBtPRDngaK8wvS6vjyL8zJgECULbZJ/0iZ45SmsZazHpr+ZhJnG6fkIVWkvABekNW9aSVnmVwhbR30yDuDAftS8ax5zQdnioRDRnMqm4mImmNFeUH2HZAgjXo9UIwANuLFfRrY+Q3iIHp4k7iSL5hsNqWKvo4tmiaZ5vLauJ7jNo5y1KD8sPm/gpUaqfFakw5Ss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VHHc8D2lA2xlBI6EcPYpL8X2L_coa5nj ZcKwYuDTLG31k.XhHXxS8.pnxsUBQv1wTbdM0vfbgg3viOkM.jC9glQvMWpkL2qH11BYRz4SFcFA 1AbXA1ktKOW4lccP5TqJfHnLcL6wJJh.kIljBT1eJh6fu33ZcjQLHojzk4.ciUyfkFBRz2pEBt4Y J70vJdmRGl9.9yR40SjWFj.9rseabxW.J4T0hbCewhPLaTiKBx55p.plvcLfXOBDNNNpEhjYgHx8 Pkl_kor3dMPMX4Myicu1fSBDYa5VqgONig4p.vEK7z4ip8WHC3tNS4XmBs1Jy X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 17 Oct 2021 00:32:58 +0000 Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 176e3fedfec2d1f5a1c9cd9fce00fd14; Sun, 17 Oct 2021 00:32:53 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> <83mtn9gmtw.fsf@gnu.org> <877dedds6t.fsf@yahoo.com> <83k0idgjzv.fsf@gnu.org> Date: Sun, 17 Oct 2021 08:32:46 +0800 In-Reply-To: <83k0idgjzv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Oct 2021 16:46:44 +0300") Message-ID: <8735p0ebip.fsf@yahoo.com> 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: 17373 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660 Cc: 50660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > There are two minor issues still: > > 1) After producing the mouse face, you should call > prepare_face_for_display. > > 2) The code you add in set_glyph_string_background_width is almost > identical to what we already have inside the loop in > get_cursor_offset_for_mouse_face, and I wonder whether we could > have a function to be called from these two places. > > Other than that, I think this is fine, thanks. Does this resolve your concerns? Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-minor-issues-with-text-display-when-cursor-is-in.patch >From 3a283bf727f5adb494689315c9e89483525402e3 Mon Sep 17 00:00:00 2001 From: Po Lu 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, and move some logic to get_glyph_pixel_width_delta_for_mouse_face. (fill_composite_glyph_string) (fill_gstring_glyph_string) (fill_glyphless_glyph_string) (fill_glyph_string) (fill_image_glyph_string) (fill_xwidget_glyph_string) (fill_stretch_glyph_string): Set s->face to mouse face whenever appropriate. (get_glyph_pixel_width_delta_for_mouse_face): New function. (set_glyph_string_background_width): Update background width and s->width to take into account differing :box properties of the mouse face, when producing strings for the cursor. (erase_phys_cursor): Redraw mouse face when erasing a cursor on top of the mouse face. * src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under mouse face because redisplay now does that for us. * src/w32term.c (w32_set_mouse_face_gc): Likewise. --- src/w32term.c | 16 ---- src/xdisp.c | 244 +++++++++++++++++++++++++++++++++++++------------- src/xterm.c | 16 ---- 3 files changed, 180 insertions(+), 96 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index 9cf250cd73..07a5cd3564 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -954,22 +954,6 @@ w32_set_cursor_gc (struct glyph_string *s) static void w32_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - /* If font in this face is same as S->font, use it. */ if (s->font == s->face->font) s->gc = s->face->gc; diff --git a/src/xdisp.c b/src/xdisp.c index f4ea7de190..7fb6cb8bfd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1179,6 +1179,11 @@ #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 int get_glyph_pixel_width_delta_for_mouse_face (struct glyph *, + struct glyph_row *, + struct window *, + struct face *, + struct face *); static void get_cursor_offset_for_mouse_face (struct window *w, struct glyph_row *row, int *offset); @@ -28125,6 +28130,20 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, s->font = s->face->font; } + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + int c = COMPOSITION_GLYPH (s->cmp, 0); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + + s->face = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, s->face, c, -1, Qnil)); + prepare_face_for_display (s->f, s->face); + } + /* All glyph strings for the same composition has the same width, i.e. the width set for the first component of the composition. */ s->width = s->first_glyph->pixel_width; @@ -28161,7 +28180,17 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, s->cmp_id = glyph->u.cmp.id; s->cmp_from = glyph->slice.cmp.from; s->cmp_to = glyph->slice.cmp.to + 1; - s->face = FACE_FROM_ID (s->f, face_id); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + prepare_face_for_display (s->f, s->face); + } + else + s->face = FACE_FROM_ID (s->f, face_id); lgstring = composition_gstring_from_id (s->cmp_id); s->font = XFONT_OBJECT (LGSTRING_FONT (lgstring)); /* The width of a composition glyph string is the sum of the @@ -28217,6 +28246,15 @@ fill_glyphless_glyph_string (struct glyph_string *s, int face_id, voffset = glyph->voffset; s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font ? s->face->font : FRAME_FONT (s->f); + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + prepare_face_for_display (s->f, s->face); + } s->nchars = 1; s->width = glyph->pixel_width; glyph++; @@ -28280,6 +28318,19 @@ fill_glyph_string (struct glyph_string *s, int face_id, s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + s->face + = FACE_FROM_ID (s->f, FACE_FOR_CHAR (s->f, s->face, + s->first_glyph->u.ch, -1, Qnil)); + prepare_face_for_display (s->f, s->face); + } + /* If the specified font could not be loaded, use the frame's font, but record the fact that we couldn't load it in S->font_not_found_p so that we can draw rectangles for the @@ -28309,6 +28360,15 @@ fill_image_glyph_string (struct glyph_string *s) s->slice = s->first_glyph->slice.img; s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + prepare_face_for_display (s->f, s->face); + } s->width = s->first_glyph->pixel_width; /* Adjust base line for subscript/superscript text. */ @@ -28323,6 +28383,15 @@ fill_xwidget_glyph_string (struct glyph_string *s) eassert (s->first_glyph->type == XWIDGET_GLYPH); s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + prepare_face_for_display (s->f, s->face); + } s->width = s->first_glyph->pixel_width; s->ybase += s->first_glyph->voffset; s->xwidget = s->first_glyph->u.xwidget; @@ -28348,6 +28417,15 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end) face_id = glyph->face_id; s->face = FACE_FROM_ID (s->f, face_id); s->font = s->face->font; + if (s->hl == DRAW_MOUSE_FACE + || (s->hl == DRAW_CURSOR && cursor_in_mouse_face_p (s->w))) + { + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (s->f); + s->face = FACE_FROM_ID_OR_NULL (s->f, hlinfo->mouse_face_face_id); + if (!s->face) + s->face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); + prepare_face_for_display (s->f, s->face); + } s->width = glyph->pixel_width; s->nchars = 1; voffset = glyph->voffset; @@ -28595,7 +28673,12 @@ right_overwriting (struct glyph_string *s) /* Set background width of glyph string S. START is the index of the first glyph following S. LAST_X is the right-most x-position + 1 - in the drawing area. */ + in the drawing area. + + If S's hl is DRAW_CURSOR, S->f is a window system frame, and the + cursor in S's window is currently under mouse face, s->width will + also be updated to take into account differing :box properties + between the original face and the mouse face. */ static void set_glyph_string_background_width (struct glyph_string *s, int start, int last_x) @@ -28617,7 +28700,28 @@ set_glyph_string_background_width (struct glyph_string *s, int start, int last_x if (s->extends_to_end_of_line_p) s->background_width = last_x - s->x + 1; else - s->background_width = s->width; + { + s->background_width = s->width; +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (s->f) + && s->hl == DRAW_CURSOR + && cursor_in_mouse_face_p (s->w)) + { + /* We will have to adjust the background width of the string + in this situation, because the glyph's pixel_width might + be inconsistent with the box of the mouse face, which + leads to an ugly over-wide cursor. */ + + struct glyph *g = s->first_glyph; + struct face *regular_face = FACE_FROM_ID (s->f, g->face_id); + s->background_width += + get_glyph_pixel_width_delta_for_mouse_face (g, s->row, s->w, + regular_face, s->face); + /* s->width is probably worth adjusting here as well. */ + s->width = s->background_width; + } +#endif + } } @@ -31752,10 +31856,6 @@ 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; @@ -31826,13 +31926,16 @@ erase_phys_cursor (struct window *w) mouse_face_here_p = true; #ifdef HAVE_WINDOW_SYSTEM - /* Adjust the physical cursor's X coordinate if needed. The problem - solved by the code below is outlined in the comment above - 'get_cursor_offset_for_mouse_face'. */ - if (mouse_face_here_p) + /* Since erasing the phys cursor will probably lead to corruption of + the mouse face display if the glyph's pixel_width is not kept up + to date with the :box property of the mouse face, just redraw the + mouse face. */ + if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p) { - get_cursor_offset_for_mouse_face (w, cursor_row, &mouse_delta); - w->phys_cursor.x += mouse_delta; + w->phys_cursor_on_p = false; + w->phys_cursor_type = NO_CURSOR; + show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE); + return; } #endif @@ -31871,10 +31974,6 @@ erase_phys_cursor (struct window *w) draw_phys_cursor_glyph (w, cursor_row, hl); mark_cursor_off: -#ifdef HAVE_WINDOW_SYSTEM - /* Restore the original cursor position. */ - w->phys_cursor.x = phys_x; -#endif w->phys_cursor_on_p = false; w->phys_cursor_type = NO_CURSOR; } @@ -35993,6 +36092,65 @@ cancel_hourglass (void) } } +/* Return a delta that must be applied to g->pixel_width in order to + obtain the correct pixel_width of G when drawn under MOUSE_FACE. + ORIGINAL_FACE is the face G was originally drawn in, and MOUSE_FACE + is the face it will be drawn in now. ROW should be the row G is + located in. W should be the window G is located in. */ +static int +get_glyph_pixel_width_delta_for_mouse_face (struct glyph *g, + struct glyph_row *row, + struct window *w, + struct face *original_face, + struct face *mouse_face) +{ + int sum = 0; + + 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 from the offset. */ + if (do_left_box_p) + sum -= max (0, original_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, original_face->box_vertical_line_width); + /* Now add the line widths from the new face. */ + if (g->left_box_line_p) + sum += max (0, mouse_face->box_vertical_line_width); + if (g->right_box_line_p) + sum += max (0, mouse_face->box_vertical_line_width); + + return sum; +} + /* Get the offset due to mouse-highlight to apply before drawing phys_cursor, and return it in OFFSET. ROW should be the row that is under mouse face and contains the phys cursor. @@ -36036,57 +36194,15 @@ get_cursor_offset_for_mouse_face (struct window *w, struct glyph_row *row, start = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; } - /* Calculate the offset to correct phys_cursor x if we are + /* Calculate the offset by which 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; - 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 from 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 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); + sum += get_glyph_pixel_width_delta_for_mouse_face (start, row, w, + FACE_FROM_ID (f, start->face_id), + mouse_face); } if (row->reversed_p) diff --git a/src/xterm.c b/src/xterm.c index 2b365929a1..0435ad341c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1573,22 +1573,6 @@ x_set_cursor_gc (struct glyph_string *s) static void x_set_mouse_face_gc (struct glyph_string *s) { - int face_id; - struct face *face; - - /* What face has to be used last for the mouse face? */ - face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; - face = FACE_FROM_ID_OR_NULL (s->f, face_id); - if (face == NULL) - face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - - if (s->first_glyph->type == CHAR_GLYPH) - face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); - else - face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); - s->face = FACE_FROM_ID (s->f, face_id); - prepare_face_for_display (s->f, s->face); - if (s->font == s->face->font) s->gc = s->face->gc; else -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 17 08:15:50 2021 Received: (at 50660-done) by debbugs.gnu.org; 17 Oct 2021 12:15:50 +0000 Received: from localhost ([127.0.0.1]:43691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mc54w-0003WB-G5 for submit@debbugs.gnu.org; Sun, 17 Oct 2021 08:15:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mc54u-0003Vx-9C for 50660-done@debbugs.gnu.org; Sun, 17 Oct 2021 08:15:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52784) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mc54p-00033z-1j; Sun, 17 Oct 2021 08:15:43 -0400 Received: from [87.69.77.57] (port=4060 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mc54Y-000412-Lh; Sun, 17 Oct 2021 08:15:42 -0400 Date: Sun, 17 Oct 2021 15:15:24 +0300 Message-Id: <83r1cjg84j.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <8735p0ebip.fsf@yahoo.com> (message from Po Lu on Sun, 17 Oct 2021 08:32:46 +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@yahoo.com> <87h7djkayk.fsf@yahoo.com> <83bl3rli53.fsf@gnu.org> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> <83mtn9gmtw.fsf@gnu.org> <877dedds6t.fsf@yahoo.com> <83k0idgjzv.fsf@gnu.org> <8735p0ebip.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50660-done Cc: 50660-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: 50660@debbugs.gnu.org > Date: Sun, 17 Oct 2021 08:32:46 +0800 > > > 1) After producing the mouse face, you should call > > prepare_face_for_display. > > > > 2) The code you add in set_glyph_string_background_width is almost > > identical to what we already have inside the loop in > > get_cursor_offset_for_mouse_face, and I wonder whether we could > > have a function to be called from these two places. > > > > Other than that, I think this is fine, thanks. > > Does this resolve your concerns? Thanks. Thanks, installed with some minor adaptations (the main of which was to find a shorter name for the new function). From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 17 08:39:49 2021 Received: (at 50660-done) by debbugs.gnu.org; 17 Oct 2021 12:39:49 +0000 Received: from localhost ([127.0.0.1]:43706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mc5S8-00046D-Tf for submit@debbugs.gnu.org; Sun, 17 Oct 2021 08:39:49 -0400 Received: from sonic311-23.consmr.mail.ne1.yahoo.com ([66.163.188.204]:35603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mc5S4-00045x-Pw for 50660-done@debbugs.gnu.org; Sun, 17 Oct 2021 08:39:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634474379; bh=Lf+aPDvcmWEW9YorKdg4PHfX83JfNSBNNcOj/xscPWw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=ECQ1d5GYz0a8UL06Q1aMcOZAY5lwtngXDCw/x4s/3BJqg17/S7r5lrMd+TQ0y5mcIfK3IELEcU4yFS/XdcUxmwsctFMM2ehSCbYbkS9JPbXXB8GQnfDAlqwgdvNFvauqoddb3DV3tmhU2WRmfGF50d5X8u4xMm9NBDF+7GNaNkZATnOEOncVXkeETunS5Y8flsu5c4TyJwduzWL8hEedKuICyQH8yQE806LPCu0quvUECbyQdM5xKKPYwATTqd737kt+Qpo/GW6QSdFBhnWRY9yrsJH9tJXuPXzYVSIIiiflyYuloBxVr8wR6rPGkNR97uL/EpkGvit++Tds12dD0w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634474379; bh=FY0hz/lWMCX0Wbpk8mfL8axghapItjFDvULumo8IUAn=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qgKiKN9qHchpRWpY4sELRh/Ts+2Kh/eDOtbp83Hrdd+9D/I4bwC+n76NMZajJ2U9b/sMn3jh2MAIVwkXcdO2h9OlIci/WULtV+xDYdNWPWOyJaVuxuAfKNlTUBjKEFbicPp/bUAvZXo9UYKJow/KvUMK7E7SeuwvbIJItYfGW+Rs+BrNrRUpo3DKxaZdDVTBTfCRHmyQ4F01i7fyatuVVUZ4acySJtBLrBtJJsbft5UcGv/luytir7z9sFPoK6zKLdp4QwU+Zc4wERvcvT3jP0k1NW0VrRmTyuCzX08ujNtgreARjGVw8q1y4EArGv4b+we3J/ehkrapzsEKiqU/rA== X-YMail-OSG: Qi1rdxQVM1kByGECCrNIa.IWBYV6aHFoFuRqneH10Ijl5mBtAIs7tAOK47yTVAR Izeyni7SWPdrwdLiMRodyA_H5_pyng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AClykjCzFh0.BZWXrfl8YOc3 aUMPghcXRZ1y88MzoxUkWkHWeqFd9HufVqplcEuM1yg2ZreNQPFaOvg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Sun, 17 Oct 2021 12:39:39 +0000 Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c607c29bde74068bde064f8bf24b1ced; Sun, 17 Oct 2021 12:39:35 +0000 (UTC) From: Po Lu To: Eli Zaretskii 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@yahoo.com> <871r4njcum.fsf@yahoo.com> <83v91yiesj.fsf@gnu.org> <8735p1izzi.fsf@yahoo.com> <83k0idijq9.fsf@gnu.org> <87lf2th4ur.fsf@yahoo.com> <83fst1iivf.fsf@gnu.org> <87y26tfp6p.fsf@yahoo.com> <83ee8lihd9.fsf@gnu.org> <87lf2tfnn5.fsf@yahoo.com> <838rytig5g.fsf@gnu.org> <874k9hfltz.fsf@yahoo.com> <83wnmdgtzg.fsf@gnu.org> <87lf2tdv7c.fsf@yahoo.com> <83o87pgnqj.fsf@gnu.org> <87fst1du3o.fsf@yahoo.com> <83mtn9gmtw.fsf@gnu.org> <877dedds6t.fsf@yahoo.com> <83k0idgjzv.fsf@gnu.org> <8735p0ebip.fsf@yahoo.com> <83r1cjg84j.fsf@gnu.org> Date: Sun, 17 Oct 2021 20:39:32 +0800 In-Reply-To: <83r1cjg84j.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Oct 2021 15:15:24 +0300") Message-ID: <87mtn7bzaz.fsf@yahoo.com> 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: 188 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50660-done Cc: 50660-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Thanks, installed with some minor adaptations (the main of which was > to find a shorter name for the new function). It works here, LGTM. Thanks! From unknown Sat Aug 16 16:14:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 15 Nov 2021 12:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator