From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame Date: Sat, 9 Jul 2022 10:35:50 +0200 Message-ID: References: <83h73w8f7i.fsf@gnu.org> <83zghn7ckd.fsf@gnu.org> <83zghm5evt.fsf@gnu.org> <5d86d890-9a2e-e4d6-13fb-da03285ea003@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31838"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56305@debbugs.gnu.org, Eli Zaretskii , monnier@iro.umontreal.ca To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 09 10:37:33 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 1oA5y0-00089a-TX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 10:37:32 +0200 Original-Received: from localhost ([::1]:50820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA5xz-0007tb-8A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 04:37:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA5xf-0007t7-QE for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 04:37:13 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oA5xV-0001KH-Um for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 04:37:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oA5xV-0006OM-Sl for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 04:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2022 08:37: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.165735576824487 (code B ref 56305); Sat, 09 Jul 2022 08:37:01 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 9 Jul 2022 08:36:08 +0000 Original-Received: from localhost ([127.0.0.1]:33716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA5we-0006Mt-FF for submit@debbugs.gnu.org; Sat, 09 Jul 2022 04:36:08 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:37445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA5wa-0006MI-1D for 56305@debbugs.gnu.org; Sat, 09 Jul 2022 04:36:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657355753; bh=rUw99wFQvdeUmq4XnUn1oycYopMeyKIAUq5klmA/SAM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=h86TLwZxzcwI1zCqp/8453c/UE+Wi3uWWjyo+AuF0VDlcFJlzxFKwmJ97tcKxp5CU Cn/Q1sJ/D2emrtnxxyyOCgIW56nr5Qr4mz2y3WvgWVC/E8hlJKmm/puPO5gkifIFaN v+2Epl9qBurscPNsztZGkfOWG63AH7230QkVNsWI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.102] ([212.95.5.83]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5G9t-1nT5Wn3t8n-0117UM; Sat, 09 Jul 2022 10:35:53 +0200 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:ujmjbFVUSruZHVJw089G1FBGVfHjGJuhgePSJ2GTyOuuyYFRUSI Y76HsdjK0SV2mSglm/cgOi7IS8qYV87hJthBckHH1pjes5vOR2z2AD1zat3O9UjMsRp7qx8 wQeo+WJGDb3HnAyXsUXWUddjaVuIw1acwpEAU5qp8VUhul59RdpoRglSepusUi5Kk1GpgzJ auytyjLytT4xVqDcClK/A== X-UI-Out-Filterresults: notjunk:1;V03:K0:+2aZl48nwHI=:VzKTG9rpXZ3sFAQSdsBckM XdCmawtMH8UevtZKYxvarqvVZozHhR1+3VVVLT/YcZ1kV5Ai6HanIyzqxxmKatfxae6j8PPkt TABK+C9qzMDiB2ItLDJc1V4wlUwiy68q9U5XZ+3efpnpuYeyo0ZWo3lp1bJX0pMPR4XLToqos mRkWsnV3uXYqJNIgb+9Wsq0KGr49a+NzxMYDdLoAx3CwPa9l7ptbXYr5kU5h2ROeJvWG3iEy8 +mOI5tkvNwjezNeqpMYdamZj2JmwdGXFoR2JZnl1cFSI5ddU/7FPVbQlcVNXp8uueMt+6kvIK b6bU0XANBMshIZzgtFzVq6PFY3M6dLl4MpfBpCRh9FdOv3doGp9+iTW7YJLk5QPPAdLtdHu2U jCn+PyEvs3gIrdeJrSSKT2JOqEFvw3a9ann6T3UbV0sThpxgcvOezPDwD6pts10Jnk/ntuHAG VeymX276GvcyYX1BfweNCS2dvQwo1m8qDP75f4rAeuBdpBHHeSC7iMy53A5zbsv5sPRtTkOUe /1n6/t8PO0zPxKnEzlri5BzH2mGHNd9DSO7We6SAvqxe4IkrrVqY4YxzIffzVPS7eJRfXM6h6 +OytineecDl3JaYi/2qglMZEsSL7ZRKp3LE0Jk5JCFHK2xJXmYPoK+OT/NNuGAalnGBTp6qdT iDdsob9+P7BLWDhzwkSoFn3E41ig07LRZL4ftEyENm1IlOE8QWhc5jtoARWkJu5CNfUTM+TAs wqAK1xL7VgaqIH7v6ffVnSMad2ZiUTv0PSefG5w4R9Ld0LNt8FHuA2mrrsKGRCNhW7F7ZT5T 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:236484 Archived-At: >> It should not deliberately raise a frame that already has focus. > > OK. We could add an extra check for the frame already having the focus. > Is there anything else suboptimal about that proposed fix to emacs-28? If by "extra check" you mean 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, then it does not improve anything here - the minibuffer frame is first lowered and then raised above the normal frame. I do not understand the idea here anyway. Why give focus to a frame that already has focus? Why does the comment say "some Emacs frame" while the code checks only the minibuffer frame? Recalling my personal experience: I used 'x-focus-frame' in one special case only - in 'handle-select-window' when 'focus-follows-mouse' is non-nil. All other calls are via 'select-frame-set-input-focus' where the intention to _also_ raise the frame is obvious. I would never have called 'x-focus-frame' from C with the default settings - every second window manager out there will handle it differently. > In the mean time, how well does the change to master work? It attempts > to fix the cause of (rather than just working around) bug #56305. The change to master fixes the bug here. martin