GNU bug report logs - #3397
NS: modeline shows inactive frame after make-frame

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Wed, 27 May 2009 01:50:04 UTC

Severity: normal

Tags: confirmed, help

Merged with 37529, 47731

Found in versions 27.0.50, 28.0.50

To reply to this bug, email your comments to 3397 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3397; Package emacs. (Wed, 27 May 2009 01:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Reitter <david.reitter <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 27 May 2009 01:50:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: NS: modeline shows inactive frame after make-frame
Date: Tue, 26 May 2009 21:42:51 -0400
When after-make-frame-functions is set to nil (which is should be by  
default),
after a (make-frame), the new frame is selected but the mode-line in  
its window shows it as unselected, even though it is selected.


after-make-frame-functions defaults to (select-frame) [ns-win.el] in  
order to work around this bug.



bug reassigned from package `emacs' to `emacs,ns'. Request was from Glenn Morris <rgm+emacsbugs <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 17 Jun 2009 07:35:08 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com:
bug#3397; Package emacs,ns. (Thu, 23 Jul 2009 16:40:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adrian Robert <adrian.b.robert <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com. (Thu, 23 Jul 2009 16:40:04 GMT) Full text and rfc822 format available.

Message #12 received at 3397 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Adrian Robert <adrian.b.robert <at> gmail.com>
To: 3397 <at> debbugs.gnu.org
Subject: Re: NS: modeline shows inactive frame after make-frame
Date: Thu, 23 Jul 2009 12:34:08 -0400
The docs for make-frame say:

> This function itself does not make the new frame the selected frame.
> The previously selected frame remains selected.  However, the
> window system may select the new frame for its own reasons, for
> instance if the frame appears under the mouse pointer and your
> setup is for focus to follow the pointer.

How does this work under X with click-to-focus?  Or W32?

If these just leave the frame unselected, perhaps we should too,  
though it seems disturbing to users.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#3397; Package emacs. (Tue, 17 May 2016 17:59:01 GMT) Full text and rfc822 format available.

Message #15 received at 3397 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Adrian Robert <adrian.b.robert <at> gmail.com>
Cc: 3397 <at> debbugs.gnu.org
Subject: Re: bug#3397: NS: modeline shows inactive frame after make-frame
Date: Tue, 17 May 2016 18:58:02 +0100
Adrian Robert <adrian.b.robert <at> gmail.com> writes:

> The docs for make-frame say:
>
>> This function itself does not make the new frame the selected frame.
>> The previously selected frame remains selected.  However, the
>> window system may select the new frame for its own reasons, for
>> instance if the frame appears under the mouse pointer and your
>> setup is for focus to follow the pointer.
>
> How does this work under X with click-to-focus?  Or W32?
>
> If these just leave the frame unselected, perhaps we should too,
> though it seems disturbing to users.

I just checked a GTK+ build and it selects the frame even when
after-make-frame-functions is set to nil, so I'd guess that the NS build
should probably do so too.

-- 
Alan Third




Added tag(s) confirmed. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Tue, 17 May 2016 17:59:02 GMT) Full text and rfc822 format available.

Merged 3397 47731. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Thu, 26 Aug 2021 18:36:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#3397; Package emacs. (Thu, 26 Aug 2021 18:41:02 GMT) Full text and rfc822 format available.

Message #22 received at 3397 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Adrian Robert <adrian.b.robert <at> gmail.com>
Cc: 3397 <at> debbugs.gnu.org
Subject: Re: bug#3397: NS: modeline shows inactive frame after make-frame
Date: Thu, 26 Aug 2021 19:40:05 +0100
Alan Third <alan <at> idiocy.org> writes:

> Adrian Robert <adrian.b.robert <at> gmail.com> writes:
>
>> The docs for make-frame say:
>>
>>> This function itself does not make the new frame the selected frame.
>>> The previously selected frame remains selected.  However, the
>>> window system may select the new frame for its own reasons, for
>>> instance if the frame appears under the mouse pointer and your
>>> setup is for focus to follow the pointer.
>>
>> How does this work under X with click-to-focus?  Or W32?
>>
>> If these just leave the frame unselected, perhaps we should too,
>> though it seems disturbing to users.
>
> I just checked a GTK+ build and it selects the frame even when
> after-make-frame-functions is set to nil, so I'd guess that the NS build
> should probably do so too.

I've just realised this is the same problem as bug#47731.

Basically the NS port only creates emacs events within the NS run loop.
Emacs lisp runs outside the NS run loop, so when some GUI action is
called from lisp, by the time it gets down to windowDidBecomeKey or
whatever it checks whether it can create an event and the answer is no,
so it doesn't bother.

In this case that means it doesn't create the FOCUS_IN_EVENT for Emacs
and so Emacs doesn't set focus on the new frame.

I've no idea why this limitation is in place.
-- 
Alan Third




Merged 3397 37529 47731. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Tue, 31 Aug 2021 19:40:02 GMT) Full text and rfc822 format available.

Added tag(s) help. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 07 Mar 2025 20:51:02 GMT) Full text and rfc822 format available.

This bug report was last modified 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.