GNU bug report logs

#78527 30.1; Mishaving new frame creation in MacOS on new desktop

version graph
PackageSource(s)Maintainer(s)
emacs PTS Buildd Popcon
Full log

Message #38 received at 78527@debbugs.gnu.org (full text, mbox, reply):

Received: (at 78527) by debbugs.gnu.org; 4 Jun 2025 17:18:11 +0000
From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 04 13:18:11 2025
Received: from localhost ([127.0.0.1]:51773 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1uMrkg-00015k-IG
	for submit@debbugs.gnu.org; Wed, 04 Jun 2025 13:18:11 -0400
Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]:48195)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <aronov.boris@gmail.com>)
 id 1uMrkd-00014u-N0
 for 78527@debbugs.gnu.org; Wed, 04 Jun 2025 13:18:09 -0400
Received: by mail-vs1-xe34.google.com with SMTP id
 ada2fe7eead31-4e2b5ffb932so15740137.0
 for <78527@debbugs.gnu.org>; Wed, 04 Jun 2025 10:18:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1749057482; x=1749662282; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=POr6en30nELGem3Ps+Dyx6rZ88oWI+vwnJyLq2zi96o=;
 b=KH7GwVhHJfmxbYMq6uhSMaOfGyeIU776J69lrFLDEW/jsRbsQ81CuvAl+JjZqZpt+b
 OGFnbrlvW8Y5FaoLnPtROISggADz6y9SEkszvAXCVdREjflELyH7Jd8um+nqKfWkQi/A
 IvIm4Sj4zXR1l6mf0NRVDhfpkpVP6q8FhLD9wCc3br2OoxymgP801I7DPjPWtq9971+g
 pp3Njbq64m36v+hw4fSfZvFH6MD4NjyWdqGj8+UqvFamEVXsg6khmX8CnDgKFIlSUcgN
 B8ps+wrcoF9CcfuaT2rRhXU2xWOMeO4DHEnnT/xcYfxhk07Ctw/qTNFm+yeeCMHfDCoa
 /jFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1749057482; x=1749662282;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=POr6en30nELGem3Ps+Dyx6rZ88oWI+vwnJyLq2zi96o=;
 b=Ww2vpjmaWluu6o7hAb0pllM+bcQ/DmvkG0EIuBK/9fHwoXBFG/Y6AtsXQ0SlWPBKlz
 HWl8PrNzQQvEnDE+MxPE4QyD8pleGCaKWIcL6GXGCXzFi1QhnHpV3w4954xGEf35XGqd
 CJ4aRL4RuNfVGNlMY5uNlx+nvJZX6RfoFAZhW3808Ubb7CZV38t4izfxJJiK7pzcs3XQ
 NC169xGzTleabg4fKpMx356itI2vWHrhNara5C+Q2gxt4iQlKBocyS09R+gir+UDV+HY
 4XIZTFfg37Zs+TW3lwSCSRuTH+pAoZpM6lnC7wm+2kbqV5SEBShlqI7OpcSREMez87TB
 W87g==
X-Forwarded-Encrypted: i=1;
 AJvYcCUks6qicwlE0Wyfp12NUEX3JzBlEAh+PA/C+6gCmB9t6ePIiynXlC6x84pPyz1PtRiv66CVTg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yy9XCheOG7WvSZdgfg/aaEVahgQFSCy7A0Fiz7MSKsTE9EF1OBY
 uoOJyYEe1xJ7/KHZakI7PcxNbpxYv2MAjH27D8rQCLsNhsrEoub5YTCpig0nCSHkEWyBNxn6h/0
 PkH8SNNmcoRN2z4gzQZVBM1uyVo+JxuQ=
X-Gm-Gg: ASbGncu8FkemEzQZ3FeS4w9MFJUEqoJBQ6hh87NL3rlzXJvVqso49zuuxkS2K6cTa3M
 w9Zi4lTiPXsxxr/AvZ09zTzZAiCNYz8s40sZzVR/+ZrfXMsc3ksDSRXvIe7KzLDlw6Ih6jIt0En
 UFni4dAuv0OTC5HjFIgp9X+IqMSAHVBMo245l74cLSut0=
X-Google-Smtp-Source: AGHT+IENIZUem7wpdaGC1hpWqQcy0r8Bm7X1n1c18bZmgDMIApmiaCpdh9CTq8bcEfMF8gZ+QHX/QIe2TuHpODpU6sQ=
X-Received: by 2002:a05:6102:a47:b0:4e6:f86b:141f with SMTP id
 ada2fe7eead31-4e746e1a4b6mr3131771137.12.1749057481787; Wed, 04 Jun 2025
 10:18:01 -0700 (PDT)
MIME-Version: 1.0
References: <CAGPpUSoPzgd4bSKoAagQniBZoS+fhMZp0ZskoW5nA24VNxmtYg@mail.gmail.com>
 <865xht6k1e.fsf@gnu.org> <db4f94fe-a395-4ece-a9bb-6d763d7d0235@gmx.at>
 <CAGPpUSr-uyVcoOBMyEjVLSCp8+=RnkCiWyjw5afSs4XnkT9N=A@mail.gmail.com>
 <97dfdc42-d676-4cf0-a1cd-b248d441a6f7@gmx.at>
In-Reply-To: <97dfdc42-d676-4cf0-a1cd-b248d441a6f7@gmx.at>
From: Boris Aronov <aronov.boris@gmail.com>
Date: Wed, 4 Jun 2025 19:17:50 +0200
X-Gm-Features: AX0GCFu1JnmL8UilI1JKORWFfE9DwaWpmSmdNF9vfX5UWLtQeLzMvwuE8jmuIpI
Message-ID: <CAGPpUSrQDJmx=PEjJRpozzHZrQAD0S-fRCxNNhPB7ViAN4yfDA@mail.gmail.com>
Subject: Re: bug#78527: 30.1;
 Mishaving new frame creation in MacOS on new desktop
To: martin rudalics <rudalics@gmx.at>
Content-Type: multipart/alternative; boundary="000000000000e4cfdb0636c22dcd"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78527
Cc: Gerd Möllmann <gerd.moellmann@gmail.com>,
 Eli Zaretskii <eliz@gnu.org>, 78527@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
[Message part 1 (text/plain, inline)]
Hi Martin,

On Wed, Jun 4, 2025 at 10:47 AM martin rudalics <rudalics@gmx.at> wrote:

> Thanks for answering.
>
> I'm still a bit dense in the following sense: You have a fullscreen
> frame, do C-x 5 2 and now see the new frame on a new desktop but it
> apparently didn't get focus because, as you say, the prompt doesn't
> appear there.  However, in your initial posting you say that "Focus
> shifts there".  What makes you think that focus shifted there?  The
> appearance of the cursor, the mode line, some decoration in the new
> frame?  Does C-x 2 split a window in the new or old frame?
>

C-x 2: New frame, surprisingly.  But subsequent commands are still messed
up.  For example, after C-x 2 I now have 2 windows in the new frame, but if
I try M-x, the prompt shows up the old frame!  That's without trying any of
the hooks you suggested.

Focus: Sorry.  I did not use the right terminology.  I only at the moment
work on my laptop with a single physical screen.  So when a "new frame
opens on new desktop",  what I see on my physical screen is the old desktop
slides off to the left and a new desktop with a new frame appears.  I
probably should not have used the word "focus."  I get a new frame with a
highlighted cursor in the main window.

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.

Another experiment (similar to what I wrote in an earlier email): Do the
C-x 5 2 from a full-screen frame.  Do a M-x.  I do *not* see the prompt.
Now use MacOS shortcut keys to switch frames (ctrl-right/left).  Then the
M-x prompt appears in BOTH frames.  In one it is selected (cursor is
highlighted) and in the other it is not (highlighted cursor is in the main
*scratch* window).  This is w/o any of the hooks you wanted me to try.
Just plain Macports Emacs -Q.

Hope this helps,
  –Boris



>  >> I'd like to understand the focus issue.  What does C-x 5 o do when run
>  >> in the old frame?
>  >
>  >
>  > - Opened "Emacs -Q"
>  > - Clicked the green button (fullscreen)
>  > - C-x 5 2 (new frame opens on another desktop)
>  > - I swipe to original desktop
>  > - C-x 5 o switches to the new one and repeating it takes me back
>
> Does C-x 5 o also switch the desktop you see?
>
>  > What does running 'foo' defined as
>  >>
>  >> (defun foo ()
>  >>     (interactive)
>  >>     (let ((frame (make-frame)))
>  >>       (sit-for 3)
>  >>       (message "%s" (frame-focus-state frame))))
>  >>
>  >
>  > When I do this in an non-full-screen frame, a new frame pops up with a
> "t"
>  >
>  > When I do it in a full-screen frame, a new frame pops up but a "t' is in
>  > the OLD frame.  And then (I think) with some delay it also appears in
> the
>  > NEW frame.
>
> This "delay" should come from the (sit-for 3) call.
>
>  >> report?  Is the message shown in both frames?
>  >>
>  >> Does 'foo' specified as
>  >>
>  >> (defun foo ()
>  >>     (interactive)
>  >>     (let ((frame (make-frame)))
>  >>       (select-frame-set-input-focus frame)))
>  >>
>  >> behave the same way?
>  >
>  >
>  > I get a "nil" in both frames.
>
> The nil would come from the return value of the frame focusing function
> so my question was silly.  What I really meant with "behave the same
> way" was whether the new frame does get input focus with this 'foo',
> that is, whether now Emacs shows the prompt in the new frame when you
> try executing a command.  I suppose the answer is "no".
>
>  > Hard to tell if it's simulataneous (as I
>  > cannot look at them at the same time) and maybe switching desktops
> triggers
>  > something.
>  >
>  >    Does
>  >>
>  >> (add-hook 'after-make-frame-functions 'select-frame-set-input-focus)
>  >>
>  >> change anything?
>  >
>  >
>  > Not really.  When I make a new frame, a new frame on a new desktop
> appears,
>  > but typing M-x shows no change on screen.  When I switch back to the
>  > original screen M-x shows on screen AND when I switch again NOW I can
> see
>  > M-x prompt on the new screen as well.
>  >
>  >
>  >    Does
>  >>
>  >> (add-hook 'after-make-frame-functions 'redirect-frame-focus)
>  >>
>  >> change anything?
>  >>
>  >
>  > No.  Same behavior as after the other add-hook.
>
> I see.
>
>  > Another oddity (or is it expected): when I switch back-and-forth between
>  > desktops having typed M-x, on one screen the focus (selected window?)
> is on
>  > the M-x line and on the other on *scratch* (where I originally ran the
> C-x
>  > 5 2 command).  Not sure which is which by now...
>  >
>  > Actually, after a few switches back and forth, the M-x line is the
> selected
>  > window in the frame where I typed it (new frame) and it's not selected
> in
>  > the old frame.
>  >
>  > Not sure if this helps in any way.
>
> Not yet.  If you have two normal (non-fullscreen) frames of the same
> Emacs process on two different desktops, type a command so that a prompt
> appears in one of them and then do C-x 5 o: Does the prompt move to the
> other frame?  Right away?
>
> BTW: Do you have Mission Control installed and active?  Maybe some
> setting in it triggers the "put the frame on the other desktop because
> the first one is too crowded" behavior.
>
> martin
>
[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Wed Sep 10 21:29:09 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.