From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57939: 29.0.50; Fixing raise-frame on Sway Date: Tue, 20 Sep 2022 09:30:57 +0800 Message-ID: <87bkran86m.fsf@yahoo.com> References: <87illj8hdk.fsf@melete.silentflame.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21104"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 57939@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 20 03:32:19 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 1oaS7X-0005Ia-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Sep 2022 03:32:19 +0200 Original-Received: from localhost ([::1]:40324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaS7V-0003uQ-JQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 21:32:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaS7G-0003uD-In for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 21:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaS7G-0005iY-8N for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 21:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaS7F-0003Uy-MO for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 21:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Sep 2022 01:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57939 X-GNU-PR-Package: emacs Original-Received: via spool by 57939-submit@debbugs.gnu.org id=B57939.166363750713427 (code B ref 57939); Tue, 20 Sep 2022 01:32:01 +0000 Original-Received: (at 57939) by debbugs.gnu.org; 20 Sep 2022 01:31:47 +0000 Original-Received: from localhost ([127.0.0.1]:55647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaS71-0003UV-AD for submit@debbugs.gnu.org; Mon, 19 Sep 2022 21:31:47 -0400 Original-Received: from sonic314-21.consmr.mail.ne1.yahoo.com ([66.163.189.147]:40742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaS6y-0003UG-MA for 57939@debbugs.gnu.org; Mon, 19 Sep 2022 21:31:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663637498; bh=AOW/vyqmzFGnyKtL58zCpF537WyMKqOYnbVSW4dE5+8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=h5QNRo2QVHhh/5qI0dGH14wosvB2OaKrgMSJKjsxLcp48wIpHuEE3WZodPn1MyhDI34chmL1TNlO2JpvcMOvFumivVJ9ZjW+Hkj2J7HZ7TNp8DReT1LPR0OUs+QKb5wGpfAvpjrD9tK8sEx7xdFGBzg/Kqotp2QIlqbEqHJg5t3XitI78Q/SPMeXfi4GcHMHDFGmx7TF4UkHY/hXFXa8Bp2lq2F7L6yS3oq+fUjRG5C7Vi35JZs7B68R4BEEpZsfnSkbdipBeSl/J4OXmkkgT0lySpcCETsBXPAmA4hpw90TCA0H1kMd4hyxYA8NGfsSyTOU059KKYr2JTvJ2235Fg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663637498; bh=9Vuz+IckqA/SQWt+3hmB8rdNQmm+X5jxPX8W9QemtyV=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=G8jw9Ua4EEyikHGWQ3agpU6OJ0/anJG0lqq/MtJZMAkcBvGXIrv9KGYjjXVivg7rwvt7Gg9b3oQprPUe3HovCR581CUn5v1dsgPrMlZoqZ98a202eI0B1SeMFR7+5sAI72AbHY1+HeVIZEzgjdDZKCVnJe/8WJG22tHmooVGpxufraXIfIodIuYdUZoVlc68zgj1Rwq/LfAytW8S00HpsBtclOlFKolIfPwj2o7uvo6B92QYhIOi6eNO/wvKMSylA83lOie7EKyppjH1xgR8Wo+eTi2fAksi61l7aC8HUN52US6q2e+aIblUFfGXXTueV3nTQjw1Hvpakq6zKssUZA== X-YMail-OSG: I5OO4WEVM1kj6tfBe3YvBG_ZLQxpC2QD0tKH5DioRS0f6ssa7quffRROCTrcJef WhScfMne24Fi4cvEg3WKItrsKaIPhS2X8wHmTFgeldjmDaQXmoyF27aEL1jdVRxhbZ77SEfC6Gbq DgfVYqLUsHCX95.EcGOyCDew08E.4FjQ73foJLgJX3ySsdZlFV8.N2KHNkrUPPJGjheYE2thwKBG qaLfJuDje1GhdFmD.Xfx5efUslfElLapnQrsEuYxh54FoTfTPQ_Qx8ldpxayuxqSb51q0aLgIPbS aevXx0sbe4GpBXle17w5mJqtGQUcLmX_uF9ky3mldBfdQO23.zaC9UYVMpJV7tIZy61wvjhUMtgX _Cl4c5bICJUcJ2GkVDrWvT03rbHDfiThtA9VuMGmGFkYndDZ_0cSoHMZPxuWTor_SQSN4knhQ6WR gp6OQPAPtJFGZGDJ9MNQra7Whb0Fp6tsKpdrNUUz7a2rqyodDIGDU7RtEya0RbA4FTf8V7XAB6YK 032dSE2s1KxT_Ul06b9RV7AsZUjnBFgrLuWnt4Agi0PRwarERGz_5ILWfUs_m7ZMi47JqGQkXB2f xrGrssAg9ziWANtwidoGCLDNtbrbTepLj.Hw.UNiWCVIGdXnRSvkQQUWaYhRmecixwKjOf5x8JXZ OpzC3IHKO8XlcB6SKAouBVxQOfewdJ7SxWY3SkwAmRhcP8ENMnY3GXr.P5O0ChDglEhtIClua3Sj s6Lpo7EsYngc.3od23KVyG69T4dQffsAKYz_WjMOwy3ajbICgxx2n8LAj2thTRG8GesO941LKzVY 6N8iInOpf3ENG8bFym.V0CnpeIYma7ZFB.sCCGcyO3 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Tue, 20 Sep 2022 01:31:38 +0000 Original-Received: by hermes--canary-production-sg3-6bb8946c47-kl2d9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 760231f16efbabf06da96212a107b065; Tue, 20 Sep 2022 01:31:34 +0000 (UTC) In-Reply-To: <87illj8hdk.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 19 Sep 2022 09:21:27 -0700") X-Mailer: WebService/1.1.20663 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:243139 Archived-At: Sean Whitton writes: > Under Sway, with pgtk, raise-frame doesn't work. We could make it work > by using Sway's IPC to send a request to "focus" the frame. This can be > done without invoking any external processes, but here is a hack using > swaymsg(1) just as a demonstration: > > (defun spw/sway-raise-frame (orig-fun &optional frame) > (unless frame (setq frame (selected-frame))) > (if (member "XDG_CURRENT_DESKTOP=sway" > (frame-parameter frame 'environment)) > (call-process "swaymsg" nil nil nil > (format "[title=\"%s\"]" > (frame-parameter frame 'name)) > "focus") > (funcall orig-fun frame))) > (advice-add 'raise-frame :around #'spw/sway-raise-frame) > On the one hand, Sway is one of the more popular Wayland compositors, so > it would be nice to support this. On the other hand, this isn't a > generic wlroots mechanism -- it will work only for Sway. (I suppose > it's possible that some other compositors will adopt Sway's IPC.) If there's anything I've learned in over 2 decades of dealing with windowing on GNU/Linux, it's that these mechanisms tend to be yanked from underneath our feet. It sounds very risky to add support for that to such a basic function in Emacs. In addition, raise-frame is not really supposed to focus the frame. But I guess that's unavoidable here. And what if there are multiple frames with the same name? What frame is raised in that case? So thanks, but this is not really the right thing for Emacs.