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.
Stale identifier rejection (state.rs):
- WeftShellWindowData gains a closed: AtomicBool field (default false).
- Dispatch<ZweftShellWindowV1, WeftShellWindowData>::request() checks the
closed flag before processing any request; posts a DefunctWindow error
(code 0) if the window has been closed, satisfying the error enum
defined in the protocol XML.
Unit tests (protocols/mod.rs, 5 tests):
- window_data_stores_fields: verifies app_id, title, role, and initial
closed state are stored correctly.
- closed_flag_transition: verifies AtomicBool store/load round-trip.
- manager_interface_name_and_version: confirms generated interface name
zweft_shell_manager_v1 and version 1.
- window_interface_name_and_version: confirms generated interface name
zweft_shell_window_v1 and version 1.
- defunct_window_error_code: confirms Error::DefunctWindow == 0 as
declared in the protocol XML.
Also adds scripts/wsl-test.sh for running cargo test with the
libdisplay-info shim in place.
Add the WEFT compositor-shell Wayland protocol and wire it into the
compositor state.
Protocol definition:
- protocol/weft-shell-unstable-v1.xml: defines zweft_shell_manager_v1
(global, bound once by servo-shell) and zweft_shell_window_v1
(per-window slot). Requests: destroy, create_window,
update_metadata, set_geometry. Events: configure, focus_changed,
window_closed, presentation_feedback.
Generated code + bindings:
- crates/weft-compositor/src/protocols/mod.rs: uses wayland-scanner
generate_interfaces! inside a __interfaces sub-module and
generate_server_code! at the server module level, following the
wayland-protocols-wlr crate structure. Exports WeftShellState
(holds the GlobalId) and WeftShellWindowData (per-window user data).
Server-side dispatch (state.rs):
- GlobalDispatch<ZweftShellManagerV1, ()>: binds the global, inits
each bound resource with unit user data.
- Dispatch<ZweftShellManagerV1, ()>: handles create_window by
initialising a ZweftShellWindowV1 and sending an initial configure.
- Dispatch<ZweftShellWindowV1, WeftShellWindowData>: handles
update_metadata (stores advisory data) and set_geometry (echoes
compositor-adjusted configure back to client).
WeftCompositorState.weft_shell_state initialised in new() alongside
all other protocol globals.
New direct deps in weft-compositor: wayland-scanner, wayland-server,
wayland-backend, bitflags (all version-matched to Smithay 0.7).
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.