Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential workaround for usage on GNOME Shell (Wayland) #29

Open
emacsomancer opened this issue Jun 7, 2022 · 5 comments
Open

potential workaround for usage on GNOME Shell (Wayland) #29

emacsomancer opened this issue Jun 7, 2022 · 5 comments

Comments

@emacsomancer
Copy link
Owner

In GNOME Shell (Wayland edition), Equake does not properly appear on top when invoked.

I think there is a possible workaround for this.

If an Emacs daemon is running, then even in GNOME Shell running on Wayland, a call to emacsclient -c --eval "(progn (select-frame-set-input-focus (selected-frame)))" creates an Emacs frame which appears on top of current windows.

Using equake-use-frame-hide set to nil (destruction of frame on "close") (requiring https://gitlab.com/emacsomancer/equake/-/issues/26 to be fixed) and a shortcut command which checks for a current Equake frame (and runs regular equake-invoke in that case) and otherwise runs an expanded version of emacsclient -c --eval "(progn (select-frame-set-input-focus (selected-frame)))" which transforms the created Emacs frame into an Equake frame seems like it could be a workaround for Wayland behaviour.

@emacsomancer
Copy link
Owner Author

mentioned in commit 860c6a9

@emacsomancer
Copy link
Owner Author

In GitLab by @edgar.vincent on Jun 9, 2022, 06:14

Thanks a lot for implementing this @emacsomancer! Unfortunately, the Equake frame isn't "always on top" when using the PKGTK (native Wayland) branch of Emacs. Do you know if anything can be done? This all sounds very tricky!

@emacsomancer
Copy link
Owner Author

Hi @edgar.vincent !

On the one hand, this is most unfortunate (though not unexpected; see below); on the other hand, the last time I tried Equake with the PGTK branch of Emacs, Equake made the whole thing completely crash, so this feels like progress of a sort! (Are you using the nativecomp PGTK branch? That was the one I tried.)

But I'm not surprised that Equake has this problem with the native Wayland branch of Emacs. The way I'm getting "Always on Top" in GNOME Shell Wayland relies on the fact that GNOME Shell Wayland seems to respect certain window properties of Xwayland programs, and so we can use wmctrl -r :ACTIVE: -b toggle,above to set an "above" feature.

As far as I can tell, the way that GNOME Shell implements the Wayland compositor, there's (ironically) no great way of doing this with native Wayland applications (see https://discourse.gnome.org/t/gtk3-with-wayland-bugs-using-windowtypehint-desktop-set-keep-below-and-glarea/6100/9 ), and no way of doing it in GTK either apparently ( https://discourse.gnome.org/t/gtk4-set-window-always-on-top-and-on-center-of-current-monitor/9068 ).

I think the only solution here would be somehow to build an actual GNOME Shell extension to interface with Equake. I've never really dealt with GNOME Shell extensions, so unlikely to be something I can do quickly at any rate. It's possible it could be a fairly minimal extension which was just able to interact in the right ways with the Equake frame, but I don't know. (I also have the worry about the fragility of GNOME Shell extensions between GNOME Shell versions).

Edit: It looks like such an extension exists already (in GNOME extensions site ; and the source-code), designed for Tilix. But as far as I can tell, it doesn't actually help with the "on-top" behaviour.

@emacsomancer
Copy link
Owner Author

In GitLab by @edgar.vincent on Jun 25, 2022, 07:35

Tank you very much for your detailed answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant