From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=C3=93scar?= Fuentes Newsgroups: gmane.emacs.bugs Subject: bug#61337: 29.0.60; Setting frame-title-format makes Emacs to steal focus Date: Thu, 09 Feb 2023 17:17:40 +0100 Message-ID: <87cz6ivmmz.fsf@telefonica.net> References: <874jrydpw8.fsf@telefonica.net> <87ilgd7e9q.fsf@yahoo.com> <87mt5pxznh.fsf@telefonica.net> <875ycd6joo.fsf@yahoo.com> <87zg9ovps9.fsf@telefonica.net> <87wn4s6c40.fsf@yahoo.com> <87v8kcvllw.fsf@telefonica.net> <87o7q469vi.fsf@yahoo.com> <87r0v0uqnh.fsf@telefonica.net> <878rh760mc.fsf@yahoo.com> <87mt5nv864.fsf@telefonica.net> <874jrv5k5w.fsf@yahoo.com> <83ilgbmdo9.fsf@gnu.org> <87mt5n3zp7.fsf@yahoo.com> <835ycbm6ci.fsf@gnu.org> <87edqy53gl.fsf@yahoo.com> <87h6vuvoq9.fsf@telefonica.net> <83o7q2ltsj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16496"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 61337@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 09 17:18:40 2023 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 1pQ9dA-00045T-J5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Feb 2023 17:18:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ9cZ-00024X-TP; Thu, 09 Feb 2023 11:18:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQ9cY-000249-Im for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:18:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQ9cY-0002qq-AM for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQ9cY-0001Ot-67 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2023 16:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61337 X-GNU-PR-Package: emacs Original-Received: via spool by 61337-submit@debbugs.gnu.org id=B61337.16759594715360 (code B ref 61337); Thu, 09 Feb 2023 16:18:02 +0000 Original-Received: (at 61337) by debbugs.gnu.org; 9 Feb 2023 16:17:51 +0000 Original-Received: from localhost ([127.0.0.1]:33456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ9cN-0001OO-5Q for submit@debbugs.gnu.org; Thu, 09 Feb 2023 11:17:51 -0500 Original-Received: from relayout01-redir.e.movistar.es ([86.109.101.201]:23253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ9cL-0001O3-A4 for 61337@debbugs.gnu.org; Thu, 09 Feb 2023 11:17:49 -0500 Original-Received: from sky (73.red-81-39-121.dynamicip.rima-tde.net [81.39.121.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout01.e.movistar.es (Postfix) with ESMTPSA id 4PCMTd6QVwzfbqT; Thu, 9 Feb 2023 17:17:40 +0100 (CET) In-Reply-To: <83o7q2ltsj.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 09 Feb 2023 17:53:17 +0200") X-TnetOut-Country: IP: 81.39.121.73 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout01 X-TnetOut-MsgID: 4PCMTd6QVwzfbqT.AC3D9 X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1676564263.15797@BjMwfyzi/JgsYHnknDe6tg 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255233 Archived-At: Eli Zaretskii writes: >> > Oscar meant that KWin focused the frame without changing the position of >> > Emacs in the window stack. That isn't the bug which was reported, Emacs >> > being focused was. >> >> Right. The part about the z-order not changing just makes the problem >> worse. >> >> For instance: let's suppose that Emacs window is hidden by some other >> application's window, (Konsole for instance) that also has the focus. >> When I switch desktops Emacs will steal the focus, but otherwise the >> screen's appearence will not change, which makes me think that Konsole >> still has the focus, then I start typing but the input go to Emacs, and >> this too often causes a mess. >> >> Same thing could happen even when Emacs' window is visible, of course. >> After all, the user does not expect that switching desktops changes the >> focus to certain application's window. > > You mean, you rely on the focus not to change while Emacs's desktop is > not shown? But if some idle timer causes Emacs to raise a frame, you > will also see Emacs with focus when you switch desktops, right? > > I'm not sure I understand the basis for this expectation. I'd > certainly not even remember in which state I left the applications > before switching away, and will look first when I switch back. Sure, but on this case you will see that Konsole's window is covering Emacs' (if Emacs' window is visible at all), so you assume that Konsole has the focus. For avoiding that you must take care of looking at some place that indicates which window has or has not focus (usually the window's title bar) noticing that Konsole has no focus, and perform an action to either give focus to Konsole or bring Emacs' window to the front. > because applications can request focus for any number of reasons. > > So I'm surprised that the fact that Emacs gets focus without your > knowing is regarded as a problem at all. Focus stealing is widely regarded as a very rude action. Imagine you are typing on some application and suddenly some other application pops out and starts receiving your keypresses. That's a disaster, even a gross security issue. Modern desktop environments implement a notification system to make possible for an application to show information or request user attention without stealing the focus, so nowadays there is no good reason for getting focus without the user's request. AFAIR in Wayland it is simply not possible for an application to forcibly get the focus. Certainly, just switching destktops is not one good reason for stealing the focus.