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: Sun, 3 Jul 2022 16:09:43 +0000 Message-ID: References: <3984f6ec-1988-f0ae-d44c-f4b92a202938@gmx.at> <83o7yb5lqe.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="10144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 56305@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 03 18:10:18 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 1o82As-0002U7-T0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 18:10:18 +0200 Original-Received: from localhost ([::1]:56048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o82Ar-0008HT-SS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 12:10:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o82Ac-0008H4-Mp for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 12:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o82Ac-0003Qu-D0 for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 12:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o82Ac-000659-5E for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 12: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: Sun, 03 Jul 2022 16: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.165686459323355 (code B ref 56305); Sun, 03 Jul 2022 16:10:02 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 3 Jul 2022 16:09:53 +0000 Original-Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o82AS-00064d-Qz for submit@debbugs.gnu.org; Sun, 03 Jul 2022 12:09:53 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:29459 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1o82AQ-00064M-NE for 56305@debbugs.gnu.org; Sun, 03 Jul 2022 12:09:51 -0400 Original-Received: (qmail 75946 invoked by uid 3782); 3 Jul 2022 16:09:44 -0000 Original-Received: from acm.muc.de (p2e5d51d4.dip0.t-ipconnect.de [46.93.81.212]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 03 Jul 2022 18:09:43 +0200 Original-Received: (qmail 5261 invoked by uid 1000); 3 Jul 2022 16:09:43 -0000 Content-Disposition: inline In-Reply-To: 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:236009 Archived-At: Hello, Martin and Eli. On Sun, Jul 03, 2022 at 10:16:04 +0200, martin rudalics wrote: > > I don't understand why the current bug is happening; focus switching in > > Emacs is complicated. However, the following patch is, at least, a > > workaround for the problem. Should I commit it? > At least here this raises the minibuffer frame above the normal frame > which may obscure the contents of the *Process List* window and thus > again force the user to use the mouse or a window manager shortcut. OK. How about using Fx_focus_frame instead? (No, I don't know what to give the function for NOACTIVATE.). This, however, would still just be a workaround. > In either case, it's not how Emacs 26 and Emacs 28.1 behaved. The > correct behavior is to make sure that the minibuffer frame is selected > and gets keyboard input while the normal frame remains fully visible. I don't think that's relevant. At the time the recursive edit for the minibuffer is started, the minibuffer frame IS the selected frame. It just doesn't have the window-manager focus. I've managed to track down the cause of this, partly, i.e. it's the change to gui_consider_frame_title (xdisp.c) where the trouble's happening. More particularly, it's in unwind_format_mode_line, L34, where there's: Fselect_window (old_window, Qt); .. If this line is commented out, the problem doesn't happen. But select-window is not meant to move the focus, is it? This is not mentioned in the doc string (Not even "This function doesn't affect the window-manager focus"), and it possibly should be. While debugging, is there any easy way of determining which frame currently has the focus? This would make it far easier to work out what's going on. At the moment, I think that the workaround with Fx_focus_frame, if it works, might be the best fix for Emacs 28.2. But there's a deeper problem buried here somewhere, which ought to be fixed properly in master. > martin -- Alan Mackenzie (Nuremberg, Germany).