From unknown Tue Jun 17 20:18:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55983 <55983@debbugs.gnu.org> To: bug#55983 <55983@debbugs.gnu.org> Subject: Status: 29.0.50; If xref-goto-xref pops up a frame, it doesn't set its input focus Reply-To: bug#55983 <55983@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:18:24 +0000 retitle 55983 29.0.50; If xref-goto-xref pops up a frame, it doesn't set it= s input focus reassign 55983 emacs submitter 55983 miha@kamnitnik.top severity 55983 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 14 16:05:56 2022 Received: (at submit) by debbugs.gnu.org; 14 Jun 2022 20:05:56 +0000 Received: from localhost ([127.0.0.1]:35870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CnU-0000sI-3j for submit@debbugs.gnu.org; Tue, 14 Jun 2022 16:05:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:60298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CnP-0000s7-Qn for submit@debbugs.gnu.org; Tue, 14 Jun 2022 16:05:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1CnP-0002tU-D7 for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 16:05:51 -0400 Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]:59088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1CnN-0006uZ-KZ for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 16:05:51 -0400 From: miha@kamnitnik.top DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1655237147; bh=xgZy5We56LRjB4s+q7rI5Nlm7y4czQ8EEouV4o24Gzk=; h=From:To:Subject:Date:From; b=tJpewJMTkfOCpfR3pPZmHu66TZIOtuTNQeCSRBq4huhNK9nQ+66buMR1dlMlAHefy Mn7gpptaeN4Lb79ooj+CcI8q35bNfB++igq31aPMibMZiGGxWGZZGW0O8c/tMrVKph 1I1LzpvIvieECV8jZeRfxANiJNKI4y0HZiokg91N4DCEqxigTY9HKLo2mkhu+ItHtb fQxOu8PDGwleIN71dXs9GBNdiW/b9CcDBsG5uNQdlldQuNLX0S67PzYxlpM6OaxHuW WbAr5xETT9dJ4hH7g93Uy3Fz+ZW3RRafb0VUaJS7VgnRNg5sHKtDF9yBexVwcnWssx 1aoYWq/B8PY/g== To: bug-gnu-emacs@gnu.org Subject: 29.0.50; If xref-goto-xref pops up a frame, it doesn't set its input focus Date: Tue, 14 Jun 2022 22:17:49 +0200 Message-ID: <86o7yv9ez6.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 24 X-Spam_score: 2.4 X-Spam_bar: ++ X-Spam_report: (2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.997, PDS_OTHER_BAD_TLD=1.997, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: To reproduce, customize pop-up-frames to non-nil and set up your window manager such that it doesn't automatically set input focus on newly created frames. Now in an xref-mode buffer, press RET on a search result (xref-goto-xref) and notice that the newly created frame doesn't receive input focus. That is because xref-goto-xref uses `display-buffer', fol [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org] 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --=-=-= Content-Type: text/plain To reproduce, customize pop-up-frames to non-nil and set up your window manager such that it doesn't automatically set input focus on newly created frames. Now in an xref-mode buffer, press RET on a search result (xref-goto-xref) and notice that the newly created frame doesn't receive input focus. That is because xref-goto-xref uses `display-buffer', followed by a `select-window'. To contrast this behaviour with grep-mode, pressing RET in a grep-mode buffer (compile-goto-error) does set input focus to the newly created frame. That is because compile-goto-error uses `pop-to-buffer`, which also calls `select-frame-set-input-focus'. Best regards. In GNU Emacs 29.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-06-14 built on miha-pc Repository revision: 175bc8e5a53740432c844b5aae1981d4f47c96f7 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Arch Linux Configured using: 'configure --prefix=/usr --without-libsystemd' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date seq gv subr-x byte-opt bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 44772 6206) (symbols 48 5717 0) (strings 32 15673 1842) (string-bytes 1 515461) (vectors 16 11098) (vector-slots 8 161431 8182) (floats 8 20 54) (intervals 56 340 1) (buffers 992 11)) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmKo7O0THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP662D/wM3oRlFD6dmnbsa+G8iNILHBTbnIsT 922VWoyac4NOSj6R7bYXt2e6abgPJC3xcFlt49Nm44o7pwgO17QWLvokYHKFhL0h o5KQzxqGJmKazbquqOikPpb8Xq4QRWDD2pkMnYPepyBGhs8f3ZpB7hrHS47TSxuI 8aQr66U//jJo/l7DzxeHDnUhFGtzMGx/amhK9LM8sy1aCPkyfxeWTYsreBfIFJ1v mEUXU22Ux8HCszJgcD5t6XHwRn53/mL47nGNllrMDT/fOUorycFqJJH3Y/XPDUK8 hEXRj5pD53X/Q1FPM3VvhhL1uWpmqmKpT5ipKtIiMMlSQhHAkEvKuqG2JSXNeaZm OvurQrPlJAkKmdE10QbHQ/bBCg9Cu8ausRQfkGtFWDx9VDRM6/OelxJ17UYZzyjC Tad7I6L3jhlXX99m7OfFLlwhjETfbT3vMcpOArVT5QM9rzOVd61SOVgDIWzmu2Eu Kv6YvbaJnAw6e+dwSOCRMc7rjTqz9aLZO7dWXPFjC+naBmTMz5UZYDYBi9y9/Jeg mUHy29fGA+LH7Cdih51jrQ3KonilpgV6LnZmaNC0ZERz6EnYEEjSQZhXpdOy6zh7 cvlT1Z5DS20r7asG/uI4uVC3ZVyTVhPy3MWKeeVPhnRRNrEwV0Ai8rTYCnttleBJ MxMps82arinJww== =AWNl -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 18 20:02:08 2022 Received: (at 55983) by debbugs.gnu.org; 19 Jun 2022 00:02:08 +0000 Received: from localhost ([127.0.0.1]:50362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2iOG-0007zm-6Y for submit@debbugs.gnu.org; Sat, 18 Jun 2022 20:02:08 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:33662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2iOD-0007zF-1N for 55983@debbugs.gnu.org; Sat, 18 Jun 2022 20:02:06 -0400 Received: by mail-wr1-f50.google.com with SMTP id i10so6276396wrc.0 for <55983@debbugs.gnu.org>; Sat, 18 Jun 2022 17:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=6TF24BxNyUX9xBuhAAmnp9BxrDDhlc9VfmIRZtSvMCc=; b=EltdUParH8tK3IDRamzO+7FVEeOxSwPggQi8FhTqmexHHkKHHQpf+Q8ErFl8ZxsjFH qzI+BGw+z2JgsaQbdKbFsBH/pHzvK+E6/RPr9NtCqsbfZS3gHf5c7nultMDOm6TBdFAD aMOP/OibKwNWf/l8q+EoxZKXfxy614oOp5sMO52n9Wxbgma5T0m5v8ZaFnxBUBLg+cj+ EWLhT8O7p9u6nfbXGVPHAVB09U+BUb5UQ/e9Nu1uOOuTwc08TriHqnQQ5svkOK7vBrA1 XdC4QDR7OC8PnkpSfVAsqNDNergwcNPURi66LIvkJlXxUxN8r5aKiVAYTDLrRN17BClX 12ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=6TF24BxNyUX9xBuhAAmnp9BxrDDhlc9VfmIRZtSvMCc=; b=Gji/sswNXM2EymM941ePmvE+XDhFxuSQr4wPAs+yk7cowKWd3lYy9nIOYTwiSkoFw4 270yGphJ7+8UOFZRW37Th43shBlK6gXuSYbk9DAaqiFNFt501vQpJkO4g+QpHn2HnhN6 v+7uQu8PZpz+Fwb5THH7ZyjiYljBuwfrUktMgLkCHVyVNNjkhdkGHCtAe2PIAo9d4aU/ 4dDhvHgEmid1jkWxnu6ca3ZFWbxs6NI8X6475EjkGhq3swdMIi6BQh6HJOxg5rRCN38G pBwWLNBIPLNLnZzRGKGMlNhrV5GUmD223pXddu/ovF0DIC2tkYrKQE58tx6NVYLlr97p 9B9A== X-Gm-Message-State: AJIora9KABe8bXmGOfmgozFhmUg6GDhHTPbiw6FUZHS8e2av2w0mVwIq CfxQQzGt+UZHfA+RVjS60Xuu3F6dYfM= X-Google-Smtp-Source: AGRyM1s5mzk6+jRr59vlElRJ/lOujboqiKIMWWkXmmG0Bgsok/KANIlCLUcl7w99sOzxvcFQtvYZYA== X-Received: by 2002:adf:b644:0:b0:210:1fde:a513 with SMTP id i4-20020adfb644000000b002101fdea513mr16664589wre.604.1655596918864; Sat, 18 Jun 2022 17:01:58 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i8-20020a5d6308000000b0021b8a0d680esm796408wru.86.2022.06.18.17.01.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Jun 2022 17:01:58 -0700 (PDT) Message-ID: Date: Sun, 19 Jun 2022 03:01:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: bug#55983: 29.0.50; If xref-goto-xref pops up a frame, it doesn't set its input focus Content-Language: en-US To: miha@kamnitnik.top, 55983@debbugs.gnu.org References: <86o7yv9ez6.fsf@miha-pc> From: Dmitry Gutov In-Reply-To: <86o7yv9ez6.fsf@miha-pc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 55983 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Hi! Thanks for the report. On 14.06.2022 23:17, miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > To reproduce, customize pop-up-frames to non-nil and set up your window > manager such that it doesn't automatically set input focus on newly > created frames. TBH I'm not sure how to setup GNOME Shell to do this. > Now in an xref-mode buffer, press RET on a search result > (xref-goto-xref) and notice that the newly created frame doesn't receive > input focus. That is because xref-goto-xref uses `display-buffer', > followed by a `select-window'. > > To contrast this behaviour with grep-mode, pressing RET in a grep-mode > buffer (compile-goto-error) does set input focus to the newly created > frame. That is because compile-goto-error uses `pop-to-buffer`, which > also calls `select-frame-set-input-focus'. Window management in Emacs is a tricky business, and the current implementation is a result of https://debbugs.gnu.org/28814 which implemented a particular kind of behavior and https://debbugs.gnu.org/33870 which did try to make it more customizable through display-buffer-alist. See both discussions for more detail. I don't have the time at the moment to try to rework it myself. Patches welcome, though. But please mind the original implementation intent. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 19 09:26:55 2022 Received: (at 55983) by debbugs.gnu.org; 19 Jun 2022 13:26:55 +0000 Received: from localhost ([127.0.0.1]:50883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2ux4-0005bE-Ga for submit@debbugs.gnu.org; Sun, 19 Jun 2022 09:26:55 -0400 Received: from kamnitnik.top ([209.250.245.214]:48276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2ux2-0005b4-PU for 55983@debbugs.gnu.org; Sun, 19 Jun 2022 09:26:53 -0400 From: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1655645210; bh=Z+VjZrJ5mWSQ2vPIRcOgdFZuDH7h3BpM2Zgsf2Jb74g=; h=From:To:Subject:In-Reply-To:References:Date:From; b=melVguDzV0Iyg8wDuaa7D9KQGV3zKLQEoqXz0Ex+kYNoiOGr5eUGk7Sa4scY6YY/v hEHua9bKVBSAMrvx/d/GxvNPSZ9z01ojK5ZsT9BS1wfU3TLcooA+LxjNm2TXa00mlF Wgbv9NiSz1iZeYZp/VdoEEtSV07Iu5kzXxiusaxG0IPVh/79dxFqmgRz7s7FspzCA0 iC1UOqIOKILKZru5afqV1rYlbEOXTZo61Kz65nzqGrt4vDcUA00vBPVU9zaWZel2GV a/Efby8s7klsdh92Kczj59GgOYJRZUx6eVUfcwp0flHD/n5VaKiL56zjnwmZ3t7hI+ jCNjIKNBh3YSQ== To: Dmitry Gutov , 55983@debbugs.gnu.org Subject: Re: bug#55983: 29.0.50; If xref-goto-xref pops up a frame, it doesn't set its input focus In-Reply-To: References: <86o7yv9ez6.fsf@miha-pc> Date: Sun, 19 Jun 2022 15:37:45 +0200 Message-ID: <8735g0u63a.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dmitry Gutov writes: > Hi! > > Thanks for the report. > > On 14.06.2022 23:17, miha--- via Bug reports for GNU Emacs, the Swiss > army knife of text editors wrote: >> To reproduce, customize pop-up-frames to non-nil and s [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 55983 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dmitry Gutov writes: > Hi! > > Thanks for the report. > > On 14.06.2022 23:17, miha--- via Bug reports for GNU Emacs, the Swiss > army knife of text editors wrote: >> To reproduce, customize pop-up-frames to non-nil and s [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > Hi! > > Thanks for the report. > > On 14.06.2022 23:17, miha--- via Bug reports for GNU Emacs, the Swiss=20 > army knife of text editors wrote: >> To reproduce, customize pop-up-frames to non-nil and set up your window >> manager such that it doesn't automatically set input focus on newly >> created frames. > > TBH I'm not sure how to setup GNOME Shell to do this. > >> Now in an xref-mode buffer, press RET on a search result >> (xref-goto-xref) and notice that the newly created frame doesn't receive >> input focus. That is because xref-goto-xref uses `display-buffer', >> followed by a `select-window'. >>=20 >> To contrast this behaviour with grep-mode, pressing RET in a grep-mode >> buffer (compile-goto-error) does set input focus to the newly created >> frame. That is because compile-goto-error uses `pop-to-buffer`, which >> also calls `select-frame-set-input-focus'. > > Window management in Emacs is a tricky business, and the current=20 > implementation is a result of https://debbugs.gnu.org/28814 which=20 > implemented a particular kind of behavior and=20 > https://debbugs.gnu.org/33870 which did try to make it more customizable= =20 > through display-buffer-alist. See both discussions for more detail. > > I don't have the time at the moment to try to rework it myself. > > Patches welcome, though. But please mind the original implementation > intent. Please see the attached patch. The only thing it adds is setting frame input focus if necessary before calling `select-window'. Other behaviour should remain the same as before. (The code and the comment is lifted from the function `pop-to-buffer'.) Best regards. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-xref-goto-xref-Set-input-focus-in-addition-to-select.patch Content-Transfer-Encoding: quoted-printable From=206fbdecf5e6a1726498287679bc276dfc0af0633f Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Sun, 19 Jun 2022 15:29:59 +0200 Subject: [PATCH] xref-goto-xref: Set input focus in addition to selecting window * lisp/progmodes/xref.el (xref--show-location): Set input focus in addition to selecting displayed window (Bug#55983). =2D-- lisp/progmodes/xref.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 683589d71c..0213ab3cc5 100644 =2D-- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -645,9 +645,15 @@ xref--show-location (xref-buffer (current-buffer))) (cond (select (if (eq select 'quit) (quit-window nil nil)) =2D (select-window =2D (with-current-buffer xref-buffer =2D (xref--show-pos-in-buf marker buf)))) + (let* ((old-frame (selected-frame)) + (window (with-current-buffer xref-buffer + (xref--show-pos-in-buf marker buf))) + (frame (window-frame window))) + ;; If we chose another frame, make sure it gets input + ;; focus. + (unless (eq frame old-frame) + (select-frame-set-input-focus frame)) + (select-window window))) (t (save-selected-window (xref--with-dedicated-window =2D-=20 2.36.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmKvJqkTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZPxnkD/9rOi0DV/JCzWvMI/d0uZa3FJpZGt2U ZpKw7wafC8+Aqx2tejzhYpEpTiFZQMhkAapyvw0bBFPYXkRy6j+oGKH2r/PDhj2v EtBFw+y7vQQ734RCNzlfexFAR3z3j3Cnc63Sea3XGEsmvUuVMNjd49cHoL3pZors V/yJeI72ttnIuBLj12bzHzwK+hNJi5F54LMQgtV9anUS3RrdbekIwFFZ4h2Qz2G4 2VFkFuzXXvlSaxBQyOY/F3JypPmrGbQ/nHj1SN7JVXK5/9oXx0ev5BK92zZq5xFo iuBINwoqImN3wjAVXAh5Kg1l2G5JqofuMS0736+mlnENDvISPdfbp4sO1QT8Hhl0 igE6UtJNL156TmFXy3mMIcqLeK3pIhQS9DOYIB0oKJu8jVFl+0dk108icQXDvC5S 90zxA2IDiuDCZ4R2IyYFKyFtL9lORrbJLM9sDlnfw8G2Ixhzs4q55SiuuK4ECXcq 7D8a4WdUXF26AtIuZ7VCszcz+tc4OfrAiYOyuZKF6GUZhw//hhLdHo1yxpGNA/SJ 60Miq2Kavydg57bQOpd+y3AbAtduPHeJdHZKy4HbU0IUKT1YiX/BcXoaoxoC3cai M8PhDeY1USWDIaQswVnM3g2LceDEFwwUZYX+qQi4ubVS6T3FDs1b9caBpbsEhZIl ipnTz0D5dWB49w== =rBpU -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 19 20:48:24 2022 Received: (at 55983-done) by debbugs.gnu.org; 20 Jun 2022 00:48:25 +0000 Received: from localhost ([127.0.0.1]:53518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o35aa-0003FL-Lw for submit@debbugs.gnu.org; Sun, 19 Jun 2022 20:48:24 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:45673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o35aV-0003F4-EU for 55983-done@debbugs.gnu.org; Sun, 19 Jun 2022 20:48:23 -0400 Received: by mail-wr1-f41.google.com with SMTP id n1so12258798wrg.12 for <55983-done@debbugs.gnu.org>; Sun, 19 Jun 2022 17:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=fRvIPcDaSTwVO5Ts1TgjIofRm5OhLkLfn6za2cr9Yes=; b=dY+ealAWEU0T/peAHAl5gYQluAAOqds8Q7AY3Dx1nUv650sDHtsdHSpinGlLY5xRU4 Je1efYpfNJdxbESsIfa9+C5oPNMwEfOrTEFWTdqXvdQGCGClWUCcwy8F8gamp3AsCYrF W3ifHadUmQRBCsquw3BvVqPZPGcxmogLMaf5X+pnWGNNMBM+MmhpkZrJCjFqg75gJOUr YgfEXD2+jnr3oHV/ioVikpcAWVRsL1sUO3C9D82l8sixzJqVMFKEwigqLcyIpZndpKph RBjgMf5Qc3hVgCSucLKT8IWm5DZB2QXBkmTya2peG4b891WUOF3Y+getr15Z92K6OYKZ YvjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=fRvIPcDaSTwVO5Ts1TgjIofRm5OhLkLfn6za2cr9Yes=; b=xWfqs8NU2drTcOicnBItgHsdMIEsnPKNw36LwsYLK6BNVO2BcLtPiDa2PTdS7VkkCq 2Xiqj5fvPovCOuCLoqfL/Vz89KSkGlxVmnpZlmZxJCHA8BKqcKMWzOLQnRdSsYcwYmPC NWSl/Xy/pPNvj/QxselUPbA5ARsQI+Azqg29MMyVqI4Tm41DAZ+WZZ1hqiErLFqZ5xkU t+Y/6TdanJ71W78Tu3CQDxNhsPFTHpLSTA2zKnZfFCqvEpHHbA1gK5zJLowjFof3krSp 9e9kI8OcZ3tyNU94Bqs/vxZPbM0hwWNEy6RHkkuYc/sCzQ/B0eF7yMo/9INyCcBDLvsN cX2Q== X-Gm-Message-State: AJIora8rOk7Zqq+/WpnHUpKH9R7uUQheiEk7bFAfBMYhq8dRnft8yyG0 IzNcnr9FfvdGeQ7ex4SWPhR3wWLTzNA= X-Google-Smtp-Source: AGRyM1szY4ah2W9yE1TOBkMjJy/eipYCYX12bzfcQ6N54WGr7uphx91CdF9P1T8aM8RnTYIPr19jHw== X-Received: by 2002:a05:6000:1142:b0:21b:844e:27cb with SMTP id d2-20020a056000114200b0021b844e27cbmr10160524wrx.306.1655686093144; Sun, 19 Jun 2022 17:48:13 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l16-20020a05600c4f1000b003942a244f40sm18132868wmq.25.2022.06.19.17.48.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Jun 2022 17:48:12 -0700 (PDT) Message-ID: Date: Mon, 20 Jun 2022 03:48:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: bug#55983: 29.0.50; If xref-goto-xref pops up a frame, it doesn't set its input focus Content-Language: en-US To: miha@kamnitnik.top, 55983-done@debbugs.gnu.org References: <86o7yv9ez6.fsf@miha-pc> <8735g0u63a.fsf@miha-pc> From: Dmitry Gutov In-Reply-To: <8735g0u63a.fsf@miha-pc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 55983-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 19.06.2022 16:37, miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Please see the attached patch. The only thing it adds is setting frame > input focus if necessary before calling `select-window'. Other behaviour > should remain the same as before. (The code and the comment is lifted > from the function `pop-to-buffer'.) Makes sense. Pushed to master, thanks! From unknown Tue Jun 17 20:18:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 18 Jul 2022 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator