Repository navigation
Description
Summary
On GNOME Wayland (Mutter has no zwlr_layer_shell_v1), Rune falls back to XWayland for overlays — but only when they take no input. Interactive overlays (interactive: true / any non-OverlayInput::None, or KeyPolicy::OnDemand) return None from the XWayland path and fail with:
rune: overlay … can't show: the platform could not create its window or surface
That breaks Hex meeting offer/recording capsules and Annotate overlays on Ubuntu GNOME, even though XWayland is present and the non-interactive dictation HUD works.
Context from Hex: anomalyco/hex#1271 (closed with a Meetings-pane fallback in hex#1273). The pane fallback avoids a silent timeout; it does not restore floating interactive capsules. The durable fix belongs here.
Environment (repro host)
- Ubuntu 24.04.5 LTS, GNOME Shell 46 / Mutter, Wayland
- XWayland available (
DISPLAY=:1) - Hex
0.0.0-dev-721(consumes Rune overlays)
Current behavior
From crates/rune/src/overlay/xwayland.rs:
if self.options.input.resolved(self.interactive) != OverlayInput::None
|| self.options.keys == KeyPolicy::OnDemand
{
return None;
}XwaylandSurface always installs an empty input SHAPE and asks for no events (platform/x11/xwayland.rs). Pure X11 overlays already support interactive input via platform/x11/overlay.rs (OverlayInput::All / region SHAPE).
So on GNOME:
layer()fails (no layer-shell)xwayland()returnsNonefor interactive overlaysprepare()fails with “could not create its window or surface”
Expected behavior
Interactive overlays on GNOME Wayland should show through XWayland (same override-redirect ARGB notification window), with pointer hit-testing for buttons/regions, without forcing the host app to open a normal focus-taking window.
Suggested fix
Extend the XWayland overlay path to match what pure X11 already does:
- Allow
OverlayInput::Alland regional input onXwaylandSurface(do not hard-rejectinteractive). - Apply SHAPE input regions instead of always emptying them; reuse the patterns in
platform/x11/overlay.rs. - Deliver pointer events on that X11 connection into the overlay runtime (today the XWayland surface drains/ignores events).
- Keep click-through outside interactive regions; avoid taking keyboard focus unless
KeyPolicyasks for it. - Leave the existing input-none path unchanged for HUD-style overlays.
Hex can keep the #1273 Meetings-pane path as a last-resort fallback when the overlay is still Unavailable.
Why not only the Hex workaround
Opening the Meetings window mid-call recovers “can record,” but:
- steals focus during a Meet/Zoom call
- still leaves the floating recording indicator unavailable
- leaves Annotate interactive overlays broken for the same Rune limitation
Related
- Hex bug: GNOME Wayland: meeting offer capsule never appears (interactive overlay; XWayland fallback is input-none only) hex#1271
- Hex workaround: Fix #1271: meeting recording offer overlay on GNOME Wayland hex#1273
- Prior HUD/XWayland notes: hex#756, hex#464; Rune changelog
2026-10-30-xwayland-overlay.md
Activity
lgwacker commentedon Nov 4, 2026
Hex follow-up tracking the product side of this: anomalyco/hex#1274 (keeps the #1273 Meetings-pane fallback as last resort once interactive XWayland overlays land here).
Interactive overlays can opt in to XWayland when Wayland has no layer…
Labs: floating meeting capsules on GNOME through XWayland (#1274) (#1277
godismyjudge95 commentedon Nov 6, 2026
A second use case, and an update on what
devalready does.Status on
devd03349e2The pointer part of this issue works now, behind an opt-in. With
OverlayOptions::xwayland_input = true, an interactive overlay shows on XWayland and takes clicks in its input shape (overlay/options.rs#L128-L134, platform/x11/xwayland.rs#L1-L7). We use it on GNOME 50 and pointer input works.Two gaps are left.
KeyPolicy::OnDemand, and then the overlay has no surface at all. An override-redirect window never gets keyboard focus.Noneas the requested display tochoose_display. SoDisplayTarget::IdandDisplayTarget::Nativeare ignored, and the overlay goes on the display under the pointer or the primary one. An app cannot put one overlay on each monitor.Our use case
A screenshot region selector. It is a full-screen overlay on every monitor that shows a frozen frame of that monitor. The user drags a box, holds Space to move it, uses the arrow keys to nudge it, Enter to capture and Escape to cancel. GNOME has no layer-shell, so we use the XWayland path.
What we do today, on Ubuntu 26.04, GNOME 50 Wayland:
DisplayTarget::Primary,OverlayPlacement::FullScreen,OverlayInput::All,xwayland_input: trueandKeyPolicy::None. Asking for keys would leave no surface.on_key, so they work only while our main window has keyboard focus. A capture started from the tray or a global shortcut while another app has focus would have no Escape (from the code path; we did not test it).Asks
on_key. We have not tested a mechanism. Two candidates: anXGrabKeyboardon the XWayland window (Mutter may refuse X grabs unless itsxwayland-grab-access-rulesallow the app), or, for a modal full-screen overlay, a fullscreenxdg_toplevelon that output instead of XWayland. A capsule-style overlay could keepKeyPolicy::None.DisplayTarget::Id/Nativeto the RandR monitor with the same geometry and pass its index asrequestedtochoose_display.Done when: on GNOME Wayland with two monitors, an app can show one interactive full-screen overlay per monitor with
DisplayTarget::Native, and Escape pressed while one of them shows reaches itson_keywith no app window focused.Posted via Claude
godismyjudge95 commentedon Nov 6, 2026
Related, filed since our comment: #146 (the display list is fixed at startup, so there is no way to put an overlay on a monitor added later) and #142 (a hidden Wayland/XWayland overlay keeps its last images in memory).
Posted via Claude
opencodejr commentedon Nov 25, 2026
Thanks for the detailed write-up. The pointer side of this is already on
dev(commit50390a3e, which references this issue), behind an opt-in:When a Wayland compositor has no layer-shell (GNOME/Mutter), an overlay that takes the pointer and has this flag set shows on XWayland. It uses the same override-redirect ARGB window as the HUD. Its input shape covers either the whole window or its hit regions, so clicks outside those regions pass through to the windows below. It reads its own pointer events: move, enter, leave, and primary and secondary buttons. Being override-redirect, it never takes keyboard focus. The flag is off by default because connecting to the X server starts XWayland on GNOME, so the host has to opt in, ideally after checking that XWayland is already running. See
OverlayOptions::xwayland_inputincrates/rune/src/overlay/options.rsandchangelog/unreleased/2026-11-04-xwayland-interactive-overlay.md.Two later fixes also matter for capsules:
For Hex, setting
xwayland_input: trueon the meeting capsules and Annotate overlays (withKeyPolicy::None) should bring back the floating, non-focus-taking path. Keep the #1273 pane fallback for when the overlay is stillUnavailable.Two limits remain, both noted in the comment above:
KeyPolicy::OnDemandoverlays still can't use XWayland.DisplayTarget::Id/Nativeand puts the overlay on the display under the pointer or the primary one.If either of these blocks you, please open a separate issue for it so it can be tracked on its own.