Skip to content

Linux: SetWindowLevel does nothing, so a floating window drops behind others (X11), with no way to tell on Wayland #573

Closed

Description

@houko

Context

Line numbers are at 4aea100 (main).

  • desktop.SetWindowLevel says "on macOS and Windows; Linux leaves stacking to the compositor" (desktop/desktop.go:165-167). The Linux backend has no setLevel at all; macOS (internal/platform/macos/services.go:560) and Windows (internal/platform/windows/system.go:1215) do.
  • GTK 4 removed gtk_window_set_keep_above, so it needs the X11 surface directly: _NET_WM_STATE_ABOVE (and _NET_WM_STATE_BELOW for WindowLevelDesktop) through a _NET_WM_STATE client message on the GdkX11Surface.
  • On Wayland there is no core protocol for stacking or for placing a window, which core/window.go:250 and :291 already document for panels. wlr-layer-shell (wlroots compositors and KDE; GNOME does not implement it) is the usual route for always-on-top, positioned surfaces.

Why it matters

A floating window (a desktop pet, a timer, a HUD, a picture-in-picture player) silently does not float on Linux: WindowLevelFloating is accepted and ignored, so the window drops behind the next one the user clicks. The desktop pet "Big Blue Fish" (github.com/Bai-Cute/big-blue-fish-desktop-pet) has a Linux build that keeps its pet on top; NSGo cannot. On Wayland the pet also cannot walk along the screen edge, as SetWindowFrame cannot place it.

Proposal

  1. X11: implement setLevel with _NET_WM_STATE_ABOVE / _NET_WM_STATE_BELOW, sent again when the window maps (window managers drop the state on unmapped windows).
  2. Wayland: report the level and the frame as unavailable through Env (e.g. Env.CanSetWindowLevel, Env.CanPlaceWindows) so the app can tell the user or fall back, instead of ignoring them silently.
  3. Optionally, a layer-shell surface on compositors that offer zwlr_layer_shell_v1, for windows that ask for the floating level and a fixed position.

Acceptance

  • On X11 under GNOME (Xorg) and KDE, a window with WindowLevelFloating stays above other windows after another window is clicked, and WindowLevelNormal puts it back.
  • On Wayland the app can read that stacking and placement are unavailable.
  • The SetWindowLevel doc names what each platform does.

Activity

  1. added a commit that references this issue on Nov 20, 2026
    41e3fcf
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