From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61337: 29.0.60; Setting frame-title-format makes Emacs to steal focus Date: Thu, 09 Feb 2023 10:43:50 +0200 Message-ID: <83ilgbmdo9.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12037"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ofv@wanadoo.es, 61337@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 09 09:44:09 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 1pQ2XJ-0002yn-2m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Feb 2023 09:44:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ2XD-0004lt-G2; Thu, 09 Feb 2023 03:44: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 1pQ2XC-0004lg-3P for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 03:44: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 1pQ2XB-0006h5-R0 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 03:44:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQ2XB-0000CU-NQ for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 03:44:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2023 08:44:01 +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.1675932218719 (code B ref 61337); Thu, 09 Feb 2023 08:44:01 +0000 Original-Received: (at 61337) by debbugs.gnu.org; 9 Feb 2023 08:43:38 +0000 Original-Received: from localhost ([127.0.0.1]:57414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ2Wo-0000BM-HC for submit@debbugs.gnu.org; Thu, 09 Feb 2023 03:43:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ2Wm-0000B9-Jp for 61337@debbugs.gnu.org; Thu, 09 Feb 2023 03:43:37 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQ2Wg-0006dr-Gs; Thu, 09 Feb 2023 03:43:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ToVMFaNhhe69NffJscxLAB2GBRVwiB03a684o9yrvtU=; b=c325J6YS1X8SI4sjUj61 8cW0MMHEiPOGbNFXcbw6LIOHFMtkOy/9rvFbxUHO6aCWx582xGRLbw3n+h80TaWvKy74uPZun/sES BSJ2xm7q4glSVXcYgmd4QVAnDZG9OrplgakcL+JmkxGQ2++yGakNqnwE8q2VHeIT1+GgLWsUNFiku SoNt6rxsgNUoVukOfPuOm5pnvufvGHLlI2DEALP7Ao7cZyg7thR3FB+dpYpKLOXhsE8WcVEZoVIon Kb9tJ/jtAamMQeToY3TEpFA3RRU7KSPOsRW+HY8jSHfO8e7I1lUONzud7UbvMuef4ev75B4SPyhuO teAz6temETfMkQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQ2Wf-0003SR-Rq; Thu, 09 Feb 2023 03:43:30 -0500 In-Reply-To: <874jrv5k5w.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) 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:255196 Archived-At: > Cc: 61337@debbugs.gnu.org > Date: Thu, 09 Feb 2023 16:15:39 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Óscar Fuentes writes: > > > Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text > > editors" writes: > > > >> If you set `icon-title-format' to the same as `frame-title-format', and > >> in addition apply this patch: > >> > >> diff --git a/src/xfns.c b/src/xfns.c > >> index 3a129211463..7f1128399a8 100644 > >> --- a/src/xfns.c > >> +++ b/src/xfns.c > >> @@ -2317,7 +2317,7 @@ x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) > >> x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) > >> { > >> /* Don't change the title if it's already NAME. */ > >> - if (EQ (name, f->title)) > >> + if (Fstring_equal (name, f->title)) > >> return; > >> > >> update_mode_lines = 38; > >> > >> does the problem go away? > > > > Yes! > > Thanks. > > Anyone know if this is ok for Emacs 29? Which part? the change in xfns.c is fine (it just makes the code slower, so perhaps test EQ first and Fstring_equal if EQ doesn't return non-zero), but if someone sets icon-title-format in a way that produces a different string from what frame-title-format does, it will not work. And forcing these two formats to produce the same strings is definitely NOT okay, not for emacs-29, not ever. However, to tell the truth, I don't really understand the phenomenon being complained about in this case. The original report says: "the z-order is not altered", whereas the conclusion of the analysis is "KWin seems to treat this as Emacs asking to be focused". Would you please describe the problem in easier-to-understand terms and use the user-facing behavior instead of technical terms like z-order, so that I could at least make up my mind whether this issue is serious, and perhaps think about alternative solutions? E.g., I don't yet understand why returning early in x_set_title should help here, and how. Thanks.