Laying windows out re-mapped every application window, which smithay
puts on top, so a session mapping another window, an exclusive zone
change or an output resize pushed the shell's home back under the
applications while it kept keyboard focus. Placement now re-maps every
window in its current order. Panels are lowered only when they
register, and a window that maps without taking focus goes beneath the
window in front, so a session cannot cover the shell's home or another
application by creating windows. A panel's zweft window that is
destroyed while its surface lives also removes its window slot.
The system shell's panel was an ordinary toplevel at winit's default
size, stacked by map order with the applications, and clicking or the
taskbar could never bring an application back to the front.
The compositor now sizes the panel to the output and keeps it beneath
every application window. A newly mapped, clicked or activated
application window is raised, marked activated and given keyboard
focus. weft-appd accepts ACTIVATE_APP for a running session and asks
the compositor to activate that session's window (AppFocusRequest),
and the system UI's taskbar entries send it when chosen.
check_activation.py runs the system shell with a solid panel page and
two test applications: the panel fills the output beneath them, each
launch comes to the front with keyboard focus, ACTIVATE_APP switches
between the sessions with focus, and activating a session that is not
running is refused.
- winit backend: client insertion and dispatch_clients failures now log
and continue instead of unwinding the event loop
- winit backend: bind/render/submit failures in the redraw handler skip
the frame and log a warning; the compositor stays running
- DRM backend: same client insertion and dispatch_clients treatment
- DRM device_added: use .context()? instead of unwrap() when inserting
the new device entry after the drm field is known to be initialised
- DRM render_output: use guard-return instead of unwrap() to access drm
state that was already verified non-None lines above
- compositor state: duplicate layer surface mapping from a misbehaving
client logs a warning and returns instead of panicking
Adds weft-compositor/src/appd_ipc.rs: WeftAppdIpc state, setup() registers a calloop
UnixListener source. Accepted connections are registered as edge-triggered read sources.
Incoming AppdToCompositor frames are decoded and dispatched; AppSurfaceCreated records
pid->session mapping in pending_pids for later wl_surface association. Wires into both
the DRM and Winit backends. Socket path: /weft/compositor.sock or
WEFT_COMPOSITOR_SOCKET override.
When a Wayland client calls wl_pointer.set_cursor, render the cursor
surface at pointer_location using render_elements_from_surface_tree.
Changes in render_output:
- Collect output_geo, pointer_location, cursor_status before the inner
rendering block (avoids borrow conflict with space+drm destructure)
- Build cursor elements as Vec<SpaceRenderElements<_, WaylandSurfaceRenderElement<_>>>
via render_elements_from_surface_tree with Kind::Cursor; hotspot is
read from CursorImageSurfaceData on the cursor wl_surface
- Cursor elements prepend space elements (highest z-index first, matching
render_elements_for_output sort order descending by z_index)
- CursorImageStatus::Hidden / Named: no cursor element emitted
New imports: SpaceRenderElements, CursorImageStatus, CursorImageSurfaceData,
render_elements_from_surface_tree, Kind, Scale, with_states
Hardware cursor plane deferred requires DRM cursor plane API audit.
Replace the clear-colour-only stub in render_output with full
surface compositing via Space::render_elements_for_output.
Changes:
- drm_device.rs: add start_time: Instant to WeftDrmData for elapsed-
time frame callbacks
- drm.rs: rewrite render_output rendering block
- collect SpaceRenderElements from Space via render_elements_for_output
which includes both mapped windows and wlr-layer-shell surfaces from
layer_map_for_output (sorted by z-index, clipped to output geometry)
- pass collected elements to DrmOutput::render_frame
- fix send_frame timing from Duration::ZERO to start_time.elapsed()
with 16ms throttle hint
- add space.refresh() and popups.cleanup() after each frame
Use explicit inner block to scope space+drm borrows so post-render
bookkeeping can access state mutably
Cursor rendering deferred requires cursor theme loading or MemoryRenderBuffer
setup; tracked separately.
Fixes found by running cargo check + clippy -D warnings + fmt --check
on openSUSE Tumbleweed WSL2 (Rust 1.93.0).
input.rs:
- Add GestureBeginEvent (fingers()), GestureEndEvent (cancelled()),
TouchEvent (slot()) supertrait imports
- Add explicit ::<B> turbofish to all handle_* dispatch calls Rust
cannot reverse-infer B from an associated type bound
- Remove now-redundant specific gesture/touch event trait imports
state.rs:
- Add reposition_request to XdgShellHandler (E0046)
- Wrap protocol-level LayerSurface in desktop::LayerSurface::new for
map_layer (E0308)
- Wrap std::env::set_var in unsafe block (E0133, stabilised unsafe in 1.80)
- Add #[allow(dead_code)] on WeftCompositorState protocol state fields
are held for delegate dispatch, not yet consumed
- Remove spurious mut on display binding
drm.rs:
- Revert initialize_output arg to &output (&Output: Into<OutputModeSource>)
- Specify element type via ::<_, WaylandSurfaceRenderElement<_>> turbofish
on initialize_output (E0277/E0308)
- Handle Result from scan_connectors, collect via IntoIterator (E0308)
- Wrap set_var in unsafe block; remove spurious mut on display
- Collapse nested if/if-let blocks per clippy::collapsible_if
- Remove useless .into() on render_node (clippy::useless_conversion)
drm_device.rs:
- Add #[allow(dead_code)] on WeftOutputSurface (device_id, global used
in hotplug handling)
scripts/wsl-check.sh (new):
- WSL2 helper: injects libdisplay-info 0.2.9 shim .pc to satisfy the
< 0.3.0 constraint while openSUSE ships 0.3.0; runs check/clippy/fmt
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.