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: Thu, 7 Jul 2022 17:25:31 +0000 Message-ID: References: <83h73w8f7i.fsf@gnu.org> <83zghn7ckd.fsf@gnu.org> <83zghm5evt.fsf@gnu.org> <878rp6qd9t.fsf@igel.home> <874jzuqcr7.fsf@igel.home> 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="27039"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, Eli Zaretskii , acm@muc.de, 56305@debbugs.gnu.org, monnier@iro.umontreal.ca To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 07 19:26:27 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 1o9VGl-0006nm-AP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 19:26:27 +0200 Original-Received: from localhost ([::1]:58164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9VGj-0007DA-SM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 13:26:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9VGM-0007Bf-7T for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 13:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9VGL-0006VS-VK for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 13:26:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9VGL-0003Aq-Q0 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 13:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2022 17:26:01 +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.165721474612179 (code B ref 56305); Thu, 07 Jul 2022 17:26:01 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 7 Jul 2022 17:25:46 +0000 Original-Received: from localhost ([127.0.0.1]:57765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9VG2-0003AK-AO for submit@debbugs.gnu.org; Thu, 07 Jul 2022 13:25:46 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:19341 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1o9VFz-0003A4-Ah for 56305@debbugs.gnu.org; Thu, 07 Jul 2022 13:25:40 -0400 Original-Received: (qmail 39196 invoked by uid 3782); 7 Jul 2022 17:25:32 -0000 Original-Received: from acm.muc.de (p4fe15b63.dip0.t-ipconnect.de [79.225.91.99]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 07 Jul 2022 19:25:32 +0200 Original-Received: (qmail 17667 invoked by uid 1000); 7 Jul 2022 17:25:31 -0000 Content-Disposition: inline In-Reply-To: <874jzuqcr7.fsf@igel.home> 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:236396 Archived-At: Hello, Andreas. On Wed, Jul 06, 2022 at 21:09:32 +0200, Andreas Schwab wrote: > On Jul 06 2022, Alan Mackenzie wrote: > > Not obviously. We're about to run the recursive edit for read_minibuf, > > so the frame with the mini-window should have the focus anyway. > Does it? I don't see why Emacs must be in the foreground when it wants > to read from the minibuffer. How about this, then? It's not perfect, since the test and the focus setting aren't atomic, but it should work OK at human speeds, shouldn't it? diff --git a/src/minibuf.c b/src/minibuf.c index 0fc7f2caa1..71fd62cede 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -896,6 +896,12 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, /* Don't allow the user to undo past this point. */ bset_undo_list (current_buffer, Qnil); + /* If some Emacs frame currently has the window-system focus, give + it to the minibuffer frame. This is sometimes needed for + minibuffer-only frames. */ + if (FRAME_DISPLAY_INFO (XFRAME (mini_frame))->x_focus_frame) + Fx_focus_frame (mini_frame, Qt); + recursive_edit_1 (); /* If cursor is on the minibuffer line, > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different." -- Alan Mackenzie (Nuremberg, Germany).