Skip to main content

Module xwm

Module xwm 

Source
Expand description

XWayland and Smithay’s X11 window manager, driven by the window policy. XWayland for the compositor’s own desktop: the Xwayland server spawned and kept running, and Smithay’s X11 window manager driven as the window policy decides.

Started only under a window policy (Compositor::start_xwayland, which SELKIES_WM on the Wayland backend asks for): the X11 clients become windows of the same Space as the Wayland ones (Window::new_x11_window), told to the policy through the same events with their ICCCM and EWMH details read into a WindowInfo (class and instance, transient parent, window type, size hints, Motif decorations, the states they asked for), and placed, framed, and stacked by the same commands. Override-redirect windows (menus, tooltips, drag icons) are placed where they ask, above everything, and never told to the policy, as X11 requires.

Smithay’s manager handles the selections (clipboard and primary between X11 and Wayland clients), XDND, _NET_CLIENT_LIST, _NET_WM_STATE, and _NET_WM_MOVERESIZE; what it does not publish and a desktop reads (_NET_WORKAREA, _NET_ACTIVE_WINDOW, _NET_CLIENT_LIST_STACKING, _NET_FRAME_EXTENTS) is written here over a second connection to the same server, since the manager’s own is private to it, and so is the name it answers to on its check window (publish_name). A crashed Xwayland is started again after a short wait, so an X11 client started later still finds a server.

Where the host has no DRM render node, the EGL vendor library a GPU container runtime injects (NVIDIA’s) segfaults inside Xwayland’s EGL initialization, and glamor would have nothing to accelerate there anyway, so Xwayland starts pinned to Mesa’s EGL vendor, loading no external EGL platform, with its buffers in shared memory (-shm, no_render_node_launch). An Xwayland a caller ships beside its own executables is named by PIXELFLUX_XWAYLAND ([XWAYLAND_VAR]) and found ahead of the host’s for that child alone.

Structs§

Atoms
AtomsCookie
Extras 🔒
The second X connection and the atoms it writes with.
XwmState
The X11 side of the compositor.

Constants§

MESA_EGL_VENDOR 🔒
The glvnd vendor file of Mesa’s EGL, the vendor Xwayland is pinned to without a render node.
NET_WM_NAME 🔒
The manager’s name on the supporting check window, which clients read to decide how to behave: Chromium and Electron draw their own frame only under a window manager they know by this name and ask for a server frame under any other, Smithay’s own among them, so the manager answers to the name the X11 backend’s manager gives, the one whose behavior the policy carries.
RESTART_DELAY 🔒
How long a crashed Xwayland waits before it is started again.
XWAYLAND_VAR
Where the Xwayland a caller ships is named, an executable called Xwayland; unset, the first on the PATH.

Functions§

configure
Carry a configure out on an X11 window: its geometry and its states.
ensure_x11_socket_dir 🔒
The directory X servers put their sockets in, which only an X server or a display manager creates: on a backend that runs no Xvfb nothing has, and Xwayland’s sockets cannot be made without it.
maintain
Start the server again where it exited and its wait passed; called on the frame timer.
no_render_node_launch 🔒
The environment and arguments Xwayland starts with: the PATH that finds a named Xwayland (xwayland_path); nothing more where the host has a DRM render node, else Mesa’s EGL vendor where it is installed, no external EGL platform, and -shm.
publish_frame
_NET_FRAME_EXTENTS and _NET_WM_ALLOWED_ACTIONS on a window the policy framed.
publish_name 🔒
Rename Smithay’s supporting check window to NET_WM_NAME.
publish_stacking
_NET_ACTIVE_WINDOW and _NET_CLIENT_LIST_STACKING, after a focus or stacking change.
publish_supported 🔒
Publish what the manager supports beyond Smithay’s own list, so clients ask for it.
publish_workarea
_NET_WORKAREA from the policy’s outputs: the primary’s workarea, as one desktop.
start
Spawn Xwayland and arm the start of its window manager once it is ready. notify is told the display number when it is.
window_info
What the policy is told about an X11 window.
window_of 🔒
The policy’s window for an X11 surface.
window_type_of 🔒
xwayland_path 🔒
The PATH Xwayland is looked up on: the directory of the one XWAYLAND_VAR names ahead of the process’s own, so a bundle’s Xwayland is found first for this child alone and the session’s applications keep the host’s programs; None where none is named or it is not there.