feat(overlay): X11 layer support via _NET_WM_STATE_ABOVE #23

Open
opened 2026-07-28 16:25:06 +02:00 by elegos · 0 comments
Owner

Summary

On X11, winit creates a standard window positioned by the window manager — no guarantee it appears above the DM session.

Proposed approach

Add an X11 path (separate x11_platform.rs) that:

  1. Detects DISPLAY env var (and absence of WAYLAND_DISPLAY).
  2. Uses x11rb or xcb to create a window with:
    • _NET_WM_STATE_ABOVE for always-on-top
    • _NET_WM_WINDOW_TYPE_NOTIFICATION or _NET_WM_WINDOW_TYPE_DIALOG
    • override_redirect = 1 (optional, more aggressive for DM use)
  3. Centers the window manually against screen dimensions.
  4. Renders via Slint's MinimalSoftwareWindow + software renderer (same as Wayland path).

Notes

  • Scope: only activate when DISPLAY is set and WAYLAND_DISPLAY is unset.
  • DM targets: lightdm-gtk-greeter, SDDM X11 session.
  • GNOME/KDE compositors may honour _NET_WM_STATE_ABOVE differently; override_redirect is more reliable for DM use but bypasses compositing.
  • Lower priority than the Wayland path (SDDM Wayland + greetd are primary targets).

Feature flag

Add a x11 feature to linux-hello-overlay, disabled by default, following the same pattern as the existing wayland feature.

## Summary On X11, winit creates a standard window positioned by the window manager — no guarantee it appears above the DM session. ## Proposed approach Add an X11 path (separate `x11_platform.rs`) that: 1. Detects `DISPLAY` env var (and absence of `WAYLAND_DISPLAY`). 2. Uses `x11rb` or `xcb` to create a window with: - `_NET_WM_STATE_ABOVE` for always-on-top - `_NET_WM_WINDOW_TYPE_NOTIFICATION` or `_NET_WM_WINDOW_TYPE_DIALOG` - `override_redirect = 1` (optional, more aggressive for DM use) 3. Centers the window manually against screen dimensions. 4. Renders via Slint's `MinimalSoftwareWindow` + software renderer (same as Wayland path). ## Notes - Scope: only activate when `DISPLAY` is set and `WAYLAND_DISPLAY` is unset. - DM targets: lightdm-gtk-greeter, SDDM X11 session. - GNOME/KDE compositors may honour `_NET_WM_STATE_ABOVE` differently; `override_redirect` is more reliable for DM use but bypasses compositing. - Lower priority than the Wayland path (SDDM Wayland + greetd are primary targets). ## Feature flag Add a `x11` feature to `linux-hello-overlay`, disabled by default, following the same pattern as the existing `wayland` feature.
elegos added this to the Foundation project 2026-07-29 10:59:36 +02:00
elegos removed this from the Foundation project 2026-07-29 10:59:42 +02:00
elegos added this to the Foundation project 2026-07-29 11:00:02 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
elegos/linux-hello#23
No description provided.