all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: alan@idiocy.org, 71866@debbugs.gnu.org
Subject: bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization
Date: Sun, 21 Jul 2024 17:55:36 +0300	[thread overview]
Message-ID: <86ttgibxqv.fsf@gnu.org> (raw)
In-Reply-To: <1659357b-5ca0-47a6-8ff3-4aa26017280b@gutov.dev> (message from Dmitry Gutov on Sun, 21 Jul 2024 16:50:18 +0300)

> Date: Sun, 21 Jul 2024 16:50:18 +0300
> Cc: 71866@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> >    . 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.

I believe you.  But I want to see both cursors, because they are
usually redrawn in tandem.

> Also FWIW it doesn't matter whether the frames display the same buffer 
> or different ones.

Yes, I know.

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

If you are sure that this happens only when Emacs is stopped at a
breakpoint, this aspect of the issue can be disregarded.

> >    . 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-`'.

OK.

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

All of the backtraces from all the calls produced by a single M-`
press.  It is best to have only the backtraces that happen when the
problem with the cursor is visible, if you can easily arrange for
that.

> In the former case, that will be a lot of text to sort through.

Yes, but it is imperative to see all the calls.

> > 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. ;-(

Could be, but in general ns_draw_window_cursor is AFAIK the only way
of redrawing the cursor, so I think we are on a good track here.

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

Eventually, if and when we find the call which causes this incomplete
redraw, you will need to step through the code and see what happens
there.  When we get there, I will try to explain the main ideas of the
code.

Thanks.





  reply	other threads:[~2024-07-21 14:55 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  3:14 bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization Dmitry Gutov
2024-07-01 11:36 ` Eli Zaretskii
2024-07-02  1:07   ` Dmitry Gutov
2024-07-06  8:56     ` Eli Zaretskii
2024-07-09  2:37       ` Dmitry Gutov
2024-07-09 11:31         ` Eli Zaretskii
2024-07-10  2:46           ` Dmitry Gutov
2024-07-10 11:58             ` Eli Zaretskii
2024-07-19  1:57               ` Dmitry Gutov
2024-07-20  8:30                 ` Eli Zaretskii
2024-07-20 15:46                   ` Dmitry Gutov
2024-07-20 16:03                     ` Eli Zaretskii
2024-07-21  0:53                       ` Dmitry Gutov
2024-07-21  7:20                         ` Eli Zaretskii
2024-07-21  9:04                           ` Eli Zaretskii
2024-07-21 23:22                             ` Dmitry Gutov
2024-07-21 13:50                           ` Dmitry Gutov
2024-07-21 14:55                             ` Eli Zaretskii [this message]
2024-07-21 23:58                               ` Dmitry Gutov
2024-07-22 14:45                                 ` Eli Zaretskii
2024-07-22 15:27                                   ` Alan Third
2024-07-22 16:02                                     ` Alan Third
2024-07-23  1:11                                       ` Dmitry Gutov
2024-07-23 11:19                                         ` Eli Zaretskii
2024-07-24  0:48                                           ` Dmitry Gutov
2024-07-24 11:32                                             ` Eli Zaretskii
2024-07-24 14:34                                               ` Dmitry Gutov
2024-07-24 16:29                                                 ` Eli Zaretskii
2024-07-24 19:22                                                   ` Dmitry Gutov
2024-07-24 20:08                                                     ` Dmitry Gutov
2024-07-25  5:01                                                     ` Eli Zaretskii
2024-07-25 16:14                                                       ` Dmitry Gutov
2024-07-22 16:10                                     ` Eli Zaretskii
2024-07-22 19:02                                       ` Alan Third
2024-07-22 19:15                                         ` Eli Zaretskii
2024-07-22 19:47                                           ` Alan Third
2024-07-23  1:06                                   ` Dmitry Gutov
2024-07-23 11:17                                     ` Eli Zaretskii
2024-07-02 23:42 ` Stefan Kangas
2024-07-07  2:03   ` Dmitry Gutov
2024-07-09 18:22     ` Stefan Kangas
2024-07-10  2:56       ` Dmitry Gutov
2024-07-23  7:40         ` Gerd Möllmann
2024-07-24  0:56           ` Dmitry Gutov
2024-07-24  3:48             ` Gerd Möllmann
2024-07-24 19:16               ` Dmitry Gutov
2024-07-25  3:03                 ` Gerd Möllmann
2024-07-25  5:39                   ` Eli Zaretskii
2024-07-25  5:58                     ` Gerd Möllmann
2024-07-25 14:46                   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ttgibxqv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71866@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=dmitry@gutov.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.