From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame Date: Tue, 5 Jul 2022 17:09:48 +0000 Message-ID: References: <83bku69nn2.fsf@gnu.org> <83iloc8yzs.fsf@gnu.org> <83h73w8f7i.fsf@gnu.org> <83zghn7ckd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, 56305@debbugs.gnu.org, monnier@iro.umontreal.ca, acm@muc.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 05 19:10:16 2022 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 1o8m3z-000A8d-QV for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 19:10:15 +0200 Original-Received: from localhost ([::1]:53878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8m3y-00015z-4M for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 13:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8m3n-000155-1b for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 13:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8m3m-0006Zp-O8 for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 13:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8m3m-0006zc-IX for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 13:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jul 2022 17:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56305 X-GNU-PR-Package: emacs Original-Received: via spool by 56305-submit@debbugs.gnu.org id=B56305.165704100026868 (code B ref 56305); Tue, 05 Jul 2022 17:10:02 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 5 Jul 2022 17:10:00 +0000 Original-Received: from localhost ([127.0.0.1]:51532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8m3j-0006zI-Ky for submit@debbugs.gnu.org; Tue, 05 Jul 2022 13:09:59 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51856 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1o8m3f-0006z1-Ho for 56305@debbugs.gnu.org; Tue, 05 Jul 2022 13:09:59 -0400 Original-Received: (qmail 19979 invoked by uid 3782); 5 Jul 2022 17:09:49 -0000 Original-Received: from acm.muc.de (p4fe15b7e.dip0.t-ipconnect.de [79.225.91.126]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 05 Jul 2022 19:09:49 +0200 Original-Received: (qmail 8020 invoked by uid 1000); 5 Jul 2022 17:09:48 -0000 Content-Disposition: inline In-Reply-To: <83zghn7ckd.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:236152 Archived-At: Hello, Eli. On Tue, Jul 05, 2022 at 19:24:02 +0300, Eli Zaretskii wrote: > > Date: Tue, 5 Jul 2022 15:59:00 +0000 > > Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, 56305@debbugs.gnu.org > > From: Alan Mackenzie > > > > After typing C-x C-c, rather than exiting, this particular Emacs > > > > prompts: > > > > "Active processes exist; kill them and exit anyway? (yes or no) " > > > > on MBF and it opens a window *Process List* on NF. > > > Sounds right to me: the frame where Emacs presents some important > > > information has focus. If you think this is wrong, please tell why. > > Well, I don't have a firm opinion on this, but yes-or-no-p is an active > > function, here. We always leave the minibuffer as the selected window > > for this function, certainly when we've a normal minibuffer in the frame. > > Why should it be different when we've got a minibuffer-only frame? > > Also, the mechanism by which NF gets the focus in the bug scenario > > appears to be random. When the focus starts out in NF and we do C-x C-c, > > the focus moves to MBF. This is inconsistent. > > The place where the randomness takes effect is the > > Fredirect_frame_focus (gfocus, frame); > > in do_switch_frame I drew attention to yesterday. > Do you have a suggestion for a change there to improve the behavior? As yet, no. I am still having trouble understanding the code well enough. But there's at least one interesting aspect. In the Elisp manual page "Input Focus" appears the following: Lisp programs can switch frames temporarily by calling the function `select-frame'. This does not alter the window system's concept of focus; rather, it escapes from the window manager's control until that control is somehow reasserted. This is sadly not true - the functions called by that Fredirect_frame_focus in do_switch_frame do indeed change the window system's focus - in particular x_frame_rehighlight (in xterm.c). If we were to change the code rather than the manual here, I think a fair bit of confusion would vanish. But this isn't something for the release branch. ;-) -- Alan Mackenzie (Nuremberg, Germany).