Repository navigation
Native Wayland overlays via wlr-layer-shell - #231
sansmoraxz wants to merge 9 commits into
Conversation
akshualy
left a comment
There was a problem hiding this comment.
Hey, thanks for your initiative and willingness to contribute! :)
I'm struggling to weigh the risk vs. fixes this brings. On one hand, I understand that supporting Wayland natively is a desired change. On the other hand, I have tested the current Overlay system to work on most distributions and desktop environments, while this PR is honest about not having done so.
I have tested it briefly on some of the configurations, and it seems the overlays are always blank on the first show (KDE and sway), and also don't properly respect scaling (iE putting it at 1.5x doesn't make the overlays bigger).
If you insist on the feature, I'd like these changes:
- An opt-in for layer shell, preferably on the Overlays page, so that XWayland stays the default
- Drop the FAILED fallback to plain windows, the current fallback to in-app is enough
If you want just the NVIDIA fixes, please extract those out to a separate PR. Here we could also either let the user decide whether they want this feature, or auto-detect via a startup probe whether the change is necessary. I'm fairly certain this issue doesn't affect every NVIDIA+WebKitGTK setup.
| "frontendDist": "../dist" | ||
| }, | ||
| "app": { | ||
| "enableGTKAppId": true, |
There was a problem hiding this comment.
Does this change anything meaningful?
There was a problem hiding this comment.
Mostly that the app's icon doesn't come in taskbar (generic wayland icon) without it when loading in wayland.
Switching window and back did paint the layers so not exactly sure what was causing it, might even be a dependency down the chain I am not skilled enough to debug on. Will give another pass over it and see. Will drop the FAILED fallback to plain windows and add toggle button for Regarding default composition for Merframe itself, IDK running it in XWayland feels quite stuttery (at least with webkit on my system, I don't have a bunch of distros lying around to test this as thoroughly though). Probably better to offer a toggle and persistent config too (but would need a full restart for changes on these to take effect). |
8569398 to
94dca11
Compare
XWayland overlays can't sit above native Wayland games. Used when the compositor offers wlr-layer-shell and gtk-layer-shell is installed, otherwise falls back to XWayland.
WebKit sometimes didn't draw onto the new surface until the next resize.
Wayland matches windows to .desktop entries by app id, not window icons.
Only self-adoption counted, so auto mode fell back to the tab.
94dca11 to
bfb488a
Compare
A window that can't become a layer surface is closed, the in-app tab still shows it.
Off by default, so existing XWayland setups don't change.
GDK rounds fractional scales up and Wayland has no primary monitor, so overlays were misplaced.
GTK never draws the first frame after a plain resize, so use a size request. Replaces the repaint after map.
Overlays on Wayland only worked when Merframe ran on XWayland, so they couldn't sit above a native Wayland game session (e.g. Proton with
PROTON_ENABLE_WAYLAND=1). When the compositor offerszwlr_layer_shell_v1andgtk-layer-shellis installed, overlays are now layer-shell surfaces on the overlay layer, above both native Wayland and XWayland games. Otherwise Merframe falls back to the existing XWayland path, then to the in-app tab.Changes summary
WAYLAND_DISPLAYonly. Overlays are click-through and take no keyboard input. They're placed on the monitor under the target position, with margins clamped to that screen. If a window can't become a layer surface after startup, it falls back to a plain overlay window.WEBKIT_DISABLE_DMABUF_RENDERER=1is set under X11/XWayland (GBM buffer allocation fails, leaving windows blank) and on the layer-shell path (blank windows /Error 71).GDK_BACKEND=x11on Wayland: overlay windows are now used in auto mode. Before, only Merframe switching itself onto XWayland counted, so auto mode fell back to the in-app tab..desktopentry.Set
GDK_BACKEND=x11to skip layer shell and use XWayland.Testing
Tested with KDE Plasma (wayland session) and Hyprland on RTX 3000 h/w. Combinations of Wayland and Xwayland sessions. Xwayland Merframe + wayland Warframe is expected to fail anyway but all other combinations shows the overlay layer. Wouldn't work in Gnome with wayland as it lacks support for most
wlr-*protocols.Also some wierd edge case where occasionally you may need to switch window and back for the layer to be visible in KDE, didn't notice in Hyprland. This is not tackled yet in this PR as I am not entirely sure what caused it.
Multi monitor setup / wierd DPI settings aren't feasibly testable by my current hardware setups.