Commit graph

19 commits

Author SHA1 Message Date
c7ad2116a0 feat(appd): add weft-appd skeleton crate and service unit
New crate implementing the application daemon entry point:
- crates/weft-appd/Cargo.toml: tokio (current-thread runtime), anyhow,
  sd-notify, tracing dependencies
- crates/weft-appd/src/main.rs: async run() resolves IPC socket path
  from WEFT_APPD_SOCKET or XDG_RUNTIME_DIR/weft/appd.sock; stubs for
  AppRegistry, IpcServer, CompositorClient, RuntimeSupervisor,
  CapabilityBroker, ResourceController per WEFT-OS-APPD-DESIGN.md;
  sd_notify(READY=1) to be sent after IpcServer bind + CompositorClient
  connect
- infra/systemd/weft-appd.service: Type=notify, Requires+After
  weft-compositor.service, After servo-shell.service

Also fix two winit backend issues that were present in the working tree:
- remove spurious mut on display binding (never mutated after init)
- wrap std::env::set_var in unsafe block (required since Rust 1.80)
2026-03-11 01:13:18 +01:00
43269c9be1 feat(compositor): render pointer cursor from CursorImageStatus::Surface
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.
2026-03-11 00:45:34 +01:00
fc5ada2079 feat(servo-shell): add servo-shell skeleton, system UI, service unit, and Wayland input audit
Includes winit Wayland input audit for servo-shell integration planning.

New files:
- crates/weft-servo-shell/: new workspace member
 - Cargo.toml: anyhow + tracing deps; no servo dep yet (requires git
 dependency on github.com/servo/servo with multi-minute build; deferred
 until embedder contract is confirmed)
 - src/main.rs: reads WAYLAND_DISPLAY and WEFT_SYSTEM_UI_HTML, locates
 system-ui.html from packaged path, calls embed_servo() stub that
 returns a descriptive error explaining the integration work remaining
- infra/shell/system-ui.html: system UI document per blueprint Section 5
 DOM structure (weft-desktop, weft-wallpaper, weft-taskbar, weft-launcher,
 weft-notification-center, weft-window); includes clock and launcher toggle
- infra/systemd/servo-shell.service: Requires+After weft-compositor.service,
 Type=simple, Restart=on-failure
- docs/architecture/winit-wayland-audit.md: audit of winit 0.30.x Wayland
 backend against WEFT input requirements; identifies keyboard shortcut
 inhibit gap, touch gesture gap, IME incomplete (zwp_text_input_v3),
 frame pacing absent (wp_presentation_time), DMA-BUF unverified;
 none block initial integration; all tracked as pre-GA work items

Modified:
- Cargo.toml: add weft-servo-shell to workspace members
- scripts/wsl-check.sh: switch to --workspace for all three gates
2026-03-11 00:34:26 +01:00
61bef1a0a7 feat(compositor): implement surface compositing and layer shell rendering
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.
2026-03-11 00:03:33 +01:00
732e572c43 fix(compositor): resolve all Linux cargo check/clippy/fmt failures
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
2026-03-10 23:43:43 +01:00
4d21b8dba0 fix(compositor): pass Output by value to initialize_output
From<Output> for OutputModeSource is more reliably implemented than
From<&Output>, avoiding a potential type mismatch on Linux CI.
2026-03-10 22:37:26 +01:00
8925ebe3df feat(compositor): implement DRM/KMS rendering path
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.
2026-03-10 22:32:21 +01:00
7d8b1cfecd ci: add libgbm-dev and libdrm-dev to linux-only job dependencies 2026-03-10 21:33:34 +01:00
767da43047 fix(compositor): pass owned surface to keyboard.set_focus, remove redundant clone 2026-03-10 21:31:59 +01:00
ae1d572803 fix(compositor): use as_deref() for WaylandFocus::wl_surface() comparisons 2026-03-10 21:28:55 +01:00
c90679ea7b fix(compositor): remove nonexistent PresentationHandler trait impl 2026-03-10 21:27:02 +01:00
fcd4a3bacd style(compositor): apply rustfmt formatting 2026-03-10 21:24:23 +01:00
e981044c43 fix(compositor): add missing BufferHandler supertrait impl for DmabufHandler 2026-03-10 21:23:33 +01:00
3ebe50ef31 fix(compositor): correct remaining Smithay 0.7 API issues
- Remove nonexistent TextInputHandler trait impl
- Add missing cursor_position_hint to PointerConstraintsHandler
- Rewrite winit/drm backends: ListeningSocketSource + insert_client
 for per-client WeftClientState; Generic<Display<D>> for dispatch
- Remove calloop direct dep; use via smithay::reexports::calloop
- Remove unused imports in input.rs
2026-03-10 21:20:28 +01:00
f70a998f67 fix(compositor): correct Smithay 0.7 API usage
- Fix smithay feature name: renderer_gles -> renderer_gl
- Rewrite winit backend: WinitEventLoop as calloop source,
 render_output free function, bind() returning (renderer, framebuffer),
 socket creation via add_socket_auto, correct WinitEvent::Redraw variant
- Fix InputMethodHandler: add dismiss_popup, remove nonexistent popup_done,
 use smithay::wayland::input_method::PopupSurface not XDG variant
- Remove nonexistent CursorShapeHandler trait; add TabletSeatHandler impl
 (required bound for delegate_cursor_shape!)
- Add state.running bool; remove LoopSignal::is_stopped() call (does not exist)
- Remove unused direct deps: calloop-wayland-source, wayland-protocols,
 wayland-protocols-wlr
- Split CI into cross-platform and linux-only jobs; install Wayland system
 dependencies in linux-only job
2026-03-10 21:09:54 +01:00
feb69be199 feat(compositor): add weft-compositor crate
- Implement WeftCompositorState with all Wayland protocol globals:
 compositor, xdg-shell, layer-shell, shm, dmabuf, output, presentation,
 text-input, input-method, pointer-constraints, cursor-shape, seat.
- Implement process_input_event covering keyboard, pointer (relative +
 absolute), axis, touch, and all gesture types (swipe, pinch, hold).
- Implement Winit backend with damage-tracked rendering loop and frame
 callbacks.
- Add DRM/KMS backend skeleton: libseat session, udev device discovery,
 calloop integration (rendering path deferred).
- Add infra/systemd/weft-compositor.service (Type=notify).
- Split CI into cross-platform and linux-only jobs.
- Exclude weft-compositor from Windows check scripts.
2026-03-10 20:56:35 +01:00
3db9541f72 Add repository validation and CI checks 2026-03-10 18:47:16 +01:00
a236a3a9f4 Add WEFT architecture and interface design documents 2026-03-10 18:47:10 +01:00
8b65f81396 Initialize Rust workspace and repository metadata 2026-03-10 18:47:06 +01:00