GNU bug report logs -
#57939
29.0.50; Fixing raise-frame on Sway
Previous Next
Full log
Message #8 received at 57939 <at> debbugs.gnu.org (full text, mbox):
Sean Whitton <spwhitton <at> spwhitton.name> 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.
This bug report was last modified 3 years ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.