unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton@spwhitton.name>
To: 57939@debbugs.gnu.org
Subject: bug#57939: 29.0.50; Fixing raise-frame on Sway
Date: Mon, 19 Sep 2022 09:21:27 -0700	[thread overview]
Message-ID: <87illj8hdk.fsf@melete.silentflame.com> (raw)

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.)

Would this be an appropriate thing to add to raise-frame?  Or is it
better left as a piece of advice?  The IPC protocol is documented here:
<https://manpages.debian.org/sway-ipc>.

-- 
Sean Whitton





             reply	other threads:[~2022-09-19 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 16:21 Sean Whitton [this message]
2022-09-20  1:30 ` bug#57939: 29.0.50; Fixing raise-frame on Sway Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-20  5:32   ` Sean Whitton
2022-09-20  6:12     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-20 10:12       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87illj8hdk.fsf@melete.silentflame.com \
    --to=spwhitton@spwhitton.name \
    --cc=57939@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).