fix(2214): fallback to xdg-shell when wlr-layer-shell is not available#2297
Open
giulianopz wants to merge 1 commit into
Open
fix(2214): fallback to xdg-shell when wlr-layer-shell is not available#2297giulianopz wants to merge 1 commit into
giulianopz wants to merge 1 commit into
Conversation
Rofi's Wayland backend currently aborts on any compositor that doesn't support `zwlr_layer_shell_v1`: Wayland-ERROR: Rofi on wayland requires support for the layer shell protocol That affects GNOME (Mutter), Weston, et alia... (see https://wayland.app/protocols/wlr-layer-shell-unstable-v1#compositor-support), since wlr-layer-shell is a wlroots protocol that those compositors don't implement and don't plan to (see https://gitlab.gnome.org/GNOME/mutter/-/work_items/973#note_668502). On these sessions rofi currently has no Wayland code path at all and falls back to XWayland — which brings to the well-known problem of a broken keyboard when launched from a compositor shortcut (XWayland keyboard grabs only work when focus is already in the X11 realm, for example, from a terminal emulator by unsetting WAYLAND_DISPLAY). This PR adds a fallback path that uses xdg-shell, xdg-activation-v1, and xdg-popup with xdg-positioner when wlr-layer-shell isn't available, so rofi runs as a native Wayland client on those compositors. The layer-shell code path is untouched and remains preferred when available; the new code is gated on: wayland->layer_shell == NULL Signed-off-by: Giuliano Panzironi <panzironi.giuliano@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current PR fixes the issue #2214.
Rofi's Wayland backend currently aborts on any compositor that doesn't support
zwlr_layer_shell_v1:That affects GNOME (Mutter), Weston, et alia... (see https://wayland.app/protocols/wlr-layer-shell-unstable-v1#compositor-support), since wlr-layer-shell is a wlroots protocol that those compositors don't implement and don't plan to (see mutter#973).
On these sessions rofi currently has no Wayland code path at all and falls back to XWayland — which brings the well-known problem of a broken keyboard when launched from a compositor shortcut (XWayland keyboard grabs only work when focus is already in the X11 realm, for example, from a terminal emulator by unsetting
WAYLAND_DISPLAY).This PR adds a fallback path that uses xdg-shell, xdg-activation-v1, and xdg-popup with xdg-positioner when wlr-layer-shell isn't available, so rofi runs as a native Wayland client on those compositors. The layer-shell code path is untouched and remains preferred when available; the new code is gated on:
wayland->layer_shell == NULLBeware that this PR is heavily LLM-assisted. I'm not a Wayland expert, but from a bunch of posts I've read (actually, even the original patch by @lbonn to support Wayland mentions it), falling back to the xdg-shell protocol is the only way to make
rofiwork under a Wayland session on GNOME/Mutter: at the moment, a large pool of Linux desktop users (including me) can no longer userofi... I don't know your stance on the LLM transition the entire world is facing right now. Feel free to take this code and improve it, or to just ignore it if you prefer. For what it's worth, I can say that I've been running this patch for a week and it works: at least, I've resolved the rofi-on-GNOME issue for myself.