Subject: Re: bug#78527: 30.1; Mishaving new frame creation in MacOS on new desktop

From: Eli Zaretskii <[email-masked]>
Date: Thu, 05 Jun 2025 08:15:25 +0300

> From: Boris Aronov <[email-masked]>
> Date: Wed, 4 Jun 2025 19:17:50 +0200
> Cc: Eli Zaretskii <[email-masked]>, Gerd Möllmann <[email-masked]>, 
> 	[email-masked]
> 
> Just noticed another weirdness, btw: 
> – I see a blinking cursor with emacs -Q.  
> – But after I have two frames in different desktops, immediately after I switch between desktops (in either
> direction), the cursor is highlighted, but does not blink.
> – In fact, this cursor thing has nothing to do with full screen or desktops: with two regular frames next to each
> other on a common desktop, when I click on a frame to switch focus there, the cursor gets highlighted,
> but does not blink until I do something...  But if I do C-x 5 2 to switch frames, it blinks as it should.  And
> when I switch from Firefox (where I am writing this) to Emacs (using Alt-TAB [=command-TAB]), the cursor
> initially does not blink.

I'm not sure the blinking cursor part is related.  The way it works is
that blink-cursor-check is added to post-command-hook, and
blink-cursor--rescan-frames is added to after-delete-frame-functions
and as an advice to after-focus-change-function.  If the cursor
doesn't start blinking when a frame receives focus, it means neither
of these hooks is called in your configuration, for some reason.  For
example, clicking on a frame to switch focus probably doesn't call
after-focus-change-function.

You can see how blink-cursor-mode works in frame.el.  Using
trace-function to trace execution of the relevant functions should
allow you to figure out what does not happen on your system that
should have happened to allow the cursor to start blinking after
switching frames or creating a new frame.