From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#3397: NS: modeline shows inactive frame after make-frame Date: Thu, 26 Aug 2021 19:40:05 +0100 Message-ID: <87sfywf3sq.fsf@idiocy.org> References: <75DCB7B5-0963-41EA-B640-0B97C993896A@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 3397@debbugs.gnu.org To: Adrian Robert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 26 20:41:10 2021 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 1mJKJJ-0004Nf-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Aug 2021 20:41:09 +0200 Original-Received: from localhost ([::1]:47234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJKJI-0005H7-LG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Aug 2021 14:41:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJKJC-0005Gt-H2 for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 14:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJKJC-0006Qi-7x for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 14:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJKJC-00032s-4W for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 14:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 18:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 3397-submit@debbugs.gnu.org id=B3397.163000321711635 (code B ref 3397); Thu, 26 Aug 2021 18:41:02 +0000 Original-Received: (at 3397) by debbugs.gnu.org; 26 Aug 2021 18:40:17 +0000 Original-Received: from localhost ([127.0.0.1]:50470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJKIT-00031b-B7 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 14:40:17 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:54119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJKIR-00031J-AM for 3397@debbugs.gnu.org; Thu, 26 Aug 2021 14:40:16 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id DA6C2380; Thu, 26 Aug 2021 18:40:08 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1630003208; bh=QPMgbWlKxChWE8z1UP5v3mv9y1pf0715nwRpgFmAz1I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=QAadpgUTtmTYNLcxCWCzAHtEcq6AW6yRaa25/jvrkJXDEomvbhgZv4YMf/Jd4OeGr ziwiFyC/uG3kOW5abWC1aFxLHNE2flwuxvxE5l/ABodUzL0btaWm3PNMEm+jB9PbMt M0ZGLb7YIk7gC3I0D+75x+DRwZEFPgBvvKhnt3C1CtIT0B4AJg4L6Wp+sYtYCC36a4 O18TXaMd/HfcDnSVA/fDEbaiJlSjs0a1FfQZvGOD6rgT79x6EORASrorLtz5cCtSuv zn2FssxfoHKIgthAxJNcBrIS6HjDDVYlgg1gKJzGbM0oMxCD6eVFFgln64oKeuKndZ kCfjCRL8NkA/g== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1mJKIH-000w2U-I2; Thu, 26 Aug 2021 19:40:05 +0100 In-Reply-To: (Alan Third's message of "Tue, 17 May 2016 18:58:02 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:212757 Archived-At: Alan Third writes: > Adrian Robert 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