Skip to content

Wayland: toplevel fallback for overlays without layer-shell (GNOME) #20

Done

Description

@kitlangton

Overlays on Wayland use layer-shell. GNOME (Mutter) doesn't implement zwlr_layer_shell_v1, so an overlay HUD doesn't show at all there.

Needed: when layer-shell isn't available, fall back to an undecorated, transparent xdg toplevel for overlays, as close as the protocol allows (no input region outside the content, no taskbar entry where possible, best-effort placement, since toplevels can't position themselves). Report through the existing capability queries which features are degraded (placement, always-on-top, click-through), so apps can adapt.

Done when: an overlay example shows on GNOME Wayland, and the capability report says what's missing.

Activity

  1. ImBIOS commented on Oct 26, 2026

    @ImBIOS
    Contributor

    Update: this one got fixed as part of PR #29 (commit "GNOME overlay fallback; single-instance token/show path").

    When no layer-shell binds (verified on nested Mutter: no zwlr_layer_shell_v1 in globals), Overlay::prepare() now falls back to an undecorated xdg toplevel window and reports what's degraded through the existing OverlayCapabilities:

    overlay-lab picker created OverlayCreated { window_number: None, capabilities: OverlayCapabilities { capture_exclusion: Unsupported, nonactivating_keys: Unsupported, global_pointer: Supported } }
    

    i.e. placement / always-on-top / click-through are best-effort on the fallback path, and the app can read exactly that from the capabilities report instead of going Unavailable as before.

    Verified: overlay-lab with OVERLAY_LAB_SECONDS + OVERLAY_LAB_PICKER=1 on mutter-46 nested (mutter --nested --wayland-display=qa-gnome): process stays up, the window path is taken, the report above is printed. Screenshots are thin on nested Mutter (no stable screencast path there), so pixel proof is the X11 scrot of the same overlay-lab pill (pill_crop_new.png, windowed_overlay.png crops in the PR body) plus the wl_snap headless snaps.

  2. opencodejr commented on Nov 25, 2026

    @opencodejr
    Contributor

    Thanks, this is still open. Current state on dev:

    What's still missing:

    1. Toplevel fallback. An undecorated, transparent xdg toplevel for the cases that currently get no surface: no XWayland, KeyPolicy::OnDemand, or pointer input without the XWayland opt-in. It would keep the input region to the content, skip the taskbar where possible and place itself best-effort.
    2. Capability report. OverlayCapabilities only has capture_exclusion, nonactivating_keys and global_pointer. It needs a way to say that placement, always-on-top and click-through are degraded. OverlayCapabilities isn't one of the types apps build as literals, but any new fields should still keep existing matches compiling.

    I'll look at making this change.

  3. opencodejr commented on Nov 25, 2026

    @opencodejr
    Contributor

    I've opened a change for this. When neither layer-shell nor XWayland can be used, an overlay on Wayland now falls back to an undecorated, transparent xdg toplevel. That covers the cases that used to end Unavailable: no XWayland, KeyPolicy::OnDemand, or pointer input without xwayland_input. The toplevel carries the app's id, so the dock groups it with the app. It's destroyed on hide, and it takes either no input or input over its whole surface.

    OverlayCapabilities gains placement, always_on_top and click_through. They're Supported on every other backend. On the toplevel, placement and always_on_top are Unsupported, and so is click_through under OverlayInput::Regions. The compositor may also focus the toplevel when it appears.

    The unit tests pass, but no overlay has been seen on GNOME Wayland yet. The "Done when" check, a manual overlay-lab run on GNOME, is still open.

    Fixed in #2197.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions