Skip to main content

Module backend

Module backend 

Source
Expand description

Backend trait definitions for compositors, input, and capture.

Structs§

PipeWireStream
A live PipeWire stream the backend is keeping open on behalf of a caller. Callers must explicitly call CaptureBackend::stop_stream — dropping does not stop the stream.
StreamToken
Backend-private state attached to a PipeWireStream.

Enums§

PointerAxis
Direction of a discrete (notched) pointer-wheel scroll.
PointerButton
Pointer button.

Traits§

CaptureBackend
Screen capture. Backends either return a PipeWire node id (the common path on mutter/KWin) that the default take_screenshot pipes through GStreamer, or override take_screenshot directly if they can produce a PNG without PipeWire (e.g. a future wlr-screencopy backend).
CompositorRuntime
Lifecycle of a headless compositor instance. A backend owns its compositor’s child processes (the compositor binary itself plus any supporting daemons like pipewire) and exposes the Wayland display name and runtime dir that client applications and sibling backends use.
InputBackend
Keyboard and pointer injection. Decoupled from the compositor trait so alternative implementations (e.g. libei) can drive the same compositor alongside a mutter/KWin/wlroots backend.

Functions§

cancellable_tail
Sleep up to dur, waking immediately if cancel trips. Returns unconditionally — the sleep is a courtesy throttle, not a critical section, so callers don’t distinguish “slept full time” from “cancel cut the sleep short.” Use for post-event tail delays in input backends; use tokio::select + an explicit Err(crate::Error::Cancelled) arm when cancelling must propagate.