From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization Date: Sun, 21 Jul 2024 16:50:18 +0300 Message-ID: <1659357b-5ca0-47a6-8ff3-4aa26017280b@gutov.dev> References: <86frstfiop.fsf@gnu.org> <03b9a1c2-986d-40ea-bdd6-d13b419c9aa0@gutov.dev> <86v81i526t.fsf@gnu.org> <1f5f741f-d599-4051-8a34-27d349360eb8@gutov.dev> <86sewiztr2.fsf@gnu.org> <867cdto3uk.fsf@gnu.org> <56cc929b-5491-4ed4-a527-d0b1a369e625@gutov.dev> <86o76sea9d.fsf@gnu.org> <72a0b2e2-600e-46f1-b583-0bed86f27d2d@gutov.dev> <86o76scaou.fsf@gnu.org> <86cyn7cito.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4774"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 71866@debbugs.gnu.org To: Eli Zaretskii , Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 21 15:51:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sVWyF-00010U-Eo for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Jul 2024 15:51:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVWxs-0001vj-WF; Sun, 21 Jul 2024 09:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVWxo-0001tl-Sb for bug-gnu-emacs@gnu.org; Sun, 21 Jul 2024 09:51:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVWxo-00061N-Kg for bug-gnu-emacs@gnu.org; Sun, 21 Jul 2024 09:51:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sVWxq-0005qn-AP for bug-gnu-emacs@gnu.org; Sun, 21 Jul 2024 09:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jul 2024 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71866 X-GNU-PR-Package: emacs Original-Received: via spool by 71866-submit@debbugs.gnu.org id=B71866.172156983122454 (code B ref 71866); Sun, 21 Jul 2024 13:51:02 +0000 Original-Received: (at 71866) by debbugs.gnu.org; 21 Jul 2024 13:50:31 +0000 Original-Received: from localhost ([127.0.0.1]:54915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWxK-0005q5-Je for submit@debbugs.gnu.org; Sun, 21 Jul 2024 09:50:31 -0400 Original-Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]:43205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWxI-0005pp-IE for 71866@debbugs.gnu.org; Sun, 21 Jul 2024 09:50:29 -0400 Original-Received: from compute8.internal (compute8.nyi.internal [10.202.2.227]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 5881411401A3; Sun, 21 Jul 2024 09:50:21 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute8.internal (MEProxy); Sun, 21 Jul 2024 09:50:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1721569821; x=1721656221; bh=A3AgCjifQdIHx2OiqCig7xpR7b7BqrTyqUiesT/Yko8=; b= Fx/kXp3JmEbtylA8UkemHVu4cLRDiSnijFlhO5F0j7fDg9V/sCw0Av557hTt9vvD cmF5VkaoA4aSQjVkfxYBZI7JScpS8zRMmRE5v+OaFwdLEhEqmgrgyOOJF88CphNp JC7nXcTrRjLGuDqN7xSW+huXsikDVFvy0Xqu5BvwkV/fkxh+mPMi/cLH3XQwMdL9 5mayAbZi2Hazovwm70BZ5OPpZbnLfegE7qpFsvrp8KuXtbqx9yLWcnZ5+AK1NUJN z+WW4nsMPCJJNbigiVtkJJGtQU0LJh3xmpGCLmJilT0aFVWeSQP/upfIcba4jHIB C1ENlKSONjii+hDeFa1uyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1721569821; x= 1721656221; bh=A3AgCjifQdIHx2OiqCig7xpR7b7BqrTyqUiesT/Yko8=; b=f nYjZmkY9KAh+OGlxPu3eTjDKY5mfRpAnoFayOX4o9GM5kaF6n96XZbKUxfZIPFKZ 9FZNtP610ke27ad5C9RmdZ8zjxbkRQm7bc6AagGJClEOEJPXbH8mX/pGJ4lrCGEE 42rpE0FM/efsa3pBYWbI63Z7kPnpwVk2BLtLNkPfmzkvOJE9wRH01JICW+85ahuD 3baNQiNpXsaqvqLcauKO7IonAb6OnYGMyPSlIUf+oq2RYsyvra4+VLRVOJesw2nO rqBtfKi4oCkNJoyl8ChTJySxrR7aoOuoeoQefP3uIiJFc2a53TLzQTePHqzRnOFN tvtAS3FtKJuLutB3OA0WA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheehgdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeiteejleffveetgeekffekfeduteevvdduffehhfffgedulefgueefgeetfefg ffenucffohhmrghinhepshhtrhgvrghmrggslhgvrdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdgu vghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 Jul 2024 09:50:20 -0400 (EDT) Content-Language: en-US In-Reply-To: <86cyn7cito.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289073 Archived-At: On 21/07/2024 10:20, Eli Zaretskii wrote: >> Date: Sun, 21 Jul 2024 03:53:26 +0300 >> Cc: 71866@debbugs.gnu.org >> From: Dmitry Gutov >> >> Perhaps it'll be easier to share a video. Sorry, it's a large file, so I >> just uploaded it to a free online hosting: https://streamable.com/d6775w >> >> The first (smaller) part is me reproducing the bug, then I switch to the >> terminal emulator, enable the breakpoint and demonstrate how the >> behavior of the same command (other-frame) changes. >> >> After the video was finished, I also repeated the same scenario, and >> saved the backtrace of the last (12th) breakpoint hit. > > Thanks. The video shows some parts of the problem, but not enough > details. It doesn't help that I don't know enough about the macOS GUI > system and conventions. Here are some details that I'm missing: > > . The two frames are arranged in a way that the cursor in the > left-most frame is not really visible when the right-most frame > partially obscures it. So it's hard to tell at all times what > kind of cursor (or no cursor) is shown in that frame. Could you > please repeat the experiment after moving the right-most frame a > bit to the right, so as not to obscure the cursor of the other > frame? IOW, I'd like to be able to see cursors in both frames > regardless of which frame is selected/has focus. I can repeat the experiment, but in my testing the problem only occurs in (all) frames other than the first/original one, regardless of their positioning. Also FWIW it doesn't matter whether the frames display the same buffer or different ones. > . Sometimes an Emacs frame shows its window as selected (judging by > the way the mode line is displayed), but the 3 colored circles at > the top left corner of the frame are shown in gray. What does > this mean, in Emacs terms, and how is that different from the > situation where both the mode line is shown as active and the > circles are shown in red/yellow/green colors? It seems to me a consequence of our having a breakpoint inside a function that updates how the frame looks (which includes its contents, the "selected" status and etc) - when I switch the focus away manually to a different program in the middle of that (to handle the breakpoint), probably that created a de-synchronization that never happens in other circumstances. > . What exactly are you doing with keyboard or mouse in the first > part, where you quickly alternate the frames? All I see is > the initial mouse click inside the left-most frame, but the > subsequent changes seemingly happen "by themselves", without any > visible trigger. That's 'other-frame', bound to 'M-`'. > . The backtrace indicates that ns_draw_window_cursor is called from > windowDidResignKey, which AFAIU is called when the focus changes. > For some reason, display_and_set_cursor, which calls > ns_draw_window_cursor, decided that cursor type should be > NO_CURSOR, although gui_update_cursor was called with > cursor_on_p=true, and the question is why? You don't show any > other backtraces, although in the video I clearly see them, and > they use other values of cursor type. In addition, I don't know > which window passed to ns_draw_window_cursor (the 'w' argument) > belongs to which frame, and without that, it is very hard to > interpret the data of the debugging session, because I need to > compare the calls with what I see in the Emacs frames. Would you like to see all the other backtraces, or some specific ones? In the former case, that will be a lot of text to sort through. > IOW, the important question is: was the problematic display, where no > cursor is shown, caused by an incorrect call to ns_draw_window_cursor, > or was it caused by some other factor? The data and the video you > presented does not allow to answer this questions. Adding the missing > details I mentioned will probably help answer them. ...and whether that all is a red herring, caused by our breakpoints, whereas the code reading to the original problem might reside somewhere else. ;-( >>> But anyway, if this is the same scenario, then why are you only >>> looking at what happens inside ns_draw_window_cursor? Redrawing the >>> block cursor involves displaying the character under cursor with >>> special colors, and ns_draw_window_cursor is just the beginning: it >>> calls other functions which actually do the job. >> >> More breakpoints means more chances for the behavior to change. I also >> don't really know which other places to look at. Stepping through all >> the callees is both time-consuming and something that is unlikely to >> help until I manage to read all of the underlying implementation and >> start making sense of the data that's being used, to be able to notice >> when this or that variable has an odd value. > > I can explain the overall logic of the implementation if it can help. Maybe I'll ask some questions later, which I know what to ask. I can understand some high-level things from the backtrace already, but the devil is in the details.