2026-03-10 20:20:28 +00:00
|
|
|
use std::{sync::Arc, time::Duration};
|
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 19:56:35 +00:00
|
|
|
|
|
|
|
|
use smithay::{
|
|
|
|
|
backend::{
|
2026-03-10 20:09:54 +00:00
|
|
|
renderer::{
|
|
|
|
|
damage::OutputDamageTracker, element::surface::WaylandSurfaceRenderElement,
|
|
|
|
|
gles::GlesRenderer,
|
|
|
|
|
},
|
|
|
|
|
winit::{self, WinitEvent},
|
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 19:56:35 +00:00
|
|
|
},
|
2026-03-10 20:09:54 +00:00
|
|
|
output::{Mode as OutputMode, Output, PhysicalProperties, Subpixel},
|
2026-03-10 20:24:23 +00:00
|
|
|
reexports::calloop::{EventLoop, Interest, Mode, PostAction, generic::Generic},
|
2026-03-10 20:09:54 +00:00
|
|
|
utils::{Rectangle, Transform},
|
2026-03-10 20:20:28 +00:00
|
|
|
wayland::socket::ListeningSocketSource,
|
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 19:56:35 +00:00
|
|
|
};
|
|
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
use crate::{
|
2026-03-11 13:29:22 +00:00
|
|
|
appd_ipc::{self, WeftAppdIpc},
|
2026-03-10 20:20:28 +00:00
|
|
|
input,
|
|
|
|
|
state::{WeftClientState, WeftCompositorState},
|
|
|
|
|
};
|
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 19:56:35 +00:00
|
|
|
|
|
|
|
|
pub fn run() -> anyhow::Result<()> {
|
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 00:13:18 +00:00
|
|
|
let display = smithay::reexports::wayland_server::Display::<WeftCompositorState>::new()?;
|
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 19:56:35 +00:00
|
|
|
let display_handle = display.handle();
|
|
|
|
|
|
|
|
|
|
let mut event_loop: EventLoop<'static, WeftCompositorState> = EventLoop::try_new()?;
|
|
|
|
|
let loop_handle = event_loop.handle();
|
|
|
|
|
let loop_signal = event_loop.get_signal();
|
|
|
|
|
|
2026-03-10 20:24:23 +00:00
|
|
|
let (mut backend, winit) =
|
|
|
|
|
winit::init().map_err(|e| anyhow::anyhow!("winit init failed: {e}"))?;
|
2026-03-10 20:09:54 +00:00
|
|
|
|
|
|
|
|
let mode = OutputMode {
|
|
|
|
|
size: backend.window_size(),
|
|
|
|
|
refresh: 60_000,
|
|
|
|
|
};
|
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 19:56:35 +00:00
|
|
|
let output = Output::new(
|
|
|
|
|
"WEFT-winit".to_string(),
|
|
|
|
|
PhysicalProperties {
|
|
|
|
|
size: (0, 0).into(),
|
|
|
|
|
subpixel: Subpixel::Unknown,
|
|
|
|
|
make: "WEFT".to_string(),
|
|
|
|
|
model: "Winit".to_string(),
|
|
|
|
|
},
|
|
|
|
|
);
|
2026-03-10 20:09:54 +00:00
|
|
|
let _global = output.create_global::<WeftCompositorState>(&display_handle);
|
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 19:56:35 +00:00
|
|
|
output.change_current_state(
|
2026-03-10 20:09:54 +00:00
|
|
|
Some(mode),
|
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 19:56:35 +00:00
|
|
|
Some(Transform::Flipped180),
|
|
|
|
|
None,
|
|
|
|
|
Some((0, 0).into()),
|
|
|
|
|
);
|
2026-03-10 20:09:54 +00:00
|
|
|
output.set_preferred(mode);
|
|
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
// Create the listening socket; each connecting client is inserted with
|
|
|
|
|
// default per-client data so CompositorHandler::client_compositor_state works.
|
|
|
|
|
let listening_socket = ListeningSocketSource::new_auto()
|
2026-03-10 20:09:54 +00:00
|
|
|
.map_err(|e| anyhow::anyhow!("Wayland socket creation failed: {e}"))?;
|
2026-03-10 20:20:28 +00:00
|
|
|
let socket_name = listening_socket.socket_name().to_os_string();
|
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 00:13:18 +00:00
|
|
|
unsafe { std::env::set_var("WAYLAND_DISPLAY", &socket_name) };
|
2026-03-10 20:09:54 +00:00
|
|
|
tracing::info!(?socket_name, "Wayland compositor socket open");
|
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 19:56:35 +00:00
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
loop_handle
|
|
|
|
|
.insert_source(listening_socket, |client_stream, _, state| {
|
2026-03-13 12:56:57 +00:00
|
|
|
if let Err(e) = state
|
2026-03-10 20:20:28 +00:00
|
|
|
.display_handle
|
|
|
|
|
.insert_client(client_stream, Arc::new(WeftClientState::default()))
|
2026-03-13 12:56:57 +00:00
|
|
|
{
|
|
|
|
|
tracing::warn!(?e, "failed to insert Wayland client");
|
|
|
|
|
}
|
2026-03-10 20:20:28 +00:00
|
|
|
})
|
|
|
|
|
.map_err(|e| anyhow::anyhow!("socket source insertion failed: {e}"))?;
|
|
|
|
|
|
|
|
|
|
// Register the display fd so calloop dispatches Wayland client messages when readable.
|
|
|
|
|
loop_handle
|
|
|
|
|
.insert_source(
|
|
|
|
|
Generic::new(display, Interest::READ, Mode::Level),
|
|
|
|
|
|_, display, state| {
|
|
|
|
|
// Safety: the display is owned by this Generic source and is never dropped
|
|
|
|
|
// while the event loop runs.
|
|
|
|
|
unsafe {
|
2026-03-13 12:56:57 +00:00
|
|
|
if let Err(e) = display.get_mut().dispatch_clients(state) {
|
|
|
|
|
tracing::warn!(?e, "Wayland dispatch error");
|
|
|
|
|
}
|
2026-03-10 20:20:28 +00:00
|
|
|
}
|
|
|
|
|
Ok(PostAction::Continue)
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
.map_err(|e| anyhow::anyhow!("display source insertion failed: {e}"))?;
|
|
|
|
|
|
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 19:56:35 +00:00
|
|
|
let mut state = WeftCompositorState::new(
|
|
|
|
|
display_handle,
|
|
|
|
|
loop_signal,
|
2026-03-10 20:09:54 +00:00
|
|
|
loop_handle.clone(),
|
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 19:56:35 +00:00
|
|
|
"seat-0".to_string(),
|
|
|
|
|
);
|
|
|
|
|
state.space.map_output(&output, (0, 0));
|
|
|
|
|
|
2026-03-11 13:29:22 +00:00
|
|
|
#[cfg(unix)]
|
|
|
|
|
{
|
|
|
|
|
state.appd_ipc = Some(WeftAppdIpc::new(appd_ipc::compositor_socket_path()));
|
|
|
|
|
if let Err(e) = appd_ipc::setup(&mut state) {
|
|
|
|
|
tracing::warn!(?e, "compositor IPC setup failed");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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 19:56:35 +00:00
|
|
|
let mut damage_tracker = OutputDamageTracker::from_output(&output);
|
2026-03-10 20:09:54 +00:00
|
|
|
let start_time = std::time::Instant::now();
|
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 19:56:35 +00:00
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
// WinitEventLoop implements calloop's EventSource; Winit events arrive
|
|
|
|
|
// through the same dispatch loop as all other compositor sources.
|
2026-03-10 20:09:54 +00:00
|
|
|
loop_handle
|
|
|
|
|
.insert_source(winit, move |event, _, state| match event {
|
|
|
|
|
WinitEvent::Resized { size, .. } => {
|
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 19:56:35 +00:00
|
|
|
let new_mode = OutputMode {
|
|
|
|
|
size,
|
|
|
|
|
refresh: 60_000,
|
|
|
|
|
};
|
2026-03-10 20:09:54 +00:00
|
|
|
output.change_current_state(Some(new_mode), None, None, None);
|
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 19:56:35 +00:00
|
|
|
output.set_preferred(new_mode);
|
2026-03-10 20:09:54 +00:00
|
|
|
state.space.map_output(&output, (0, 0));
|
|
|
|
|
damage_tracker = OutputDamageTracker::from_output(&output);
|
2026-03-13 09:38:01 +00:00
|
|
|
state
|
|
|
|
|
.weft_shell_state
|
|
|
|
|
.reconfigure_panels(0, 0, size.w, size.h);
|
feat: appd IPC relay, WIT interfaces, UI kit, gesture routing, and CI hardening
- weft-appd: per-session IPC socket paths; bidirectional Wasm-HTML JSON relay
via spawn_ipc_relay; SO_PEERCRED UID check on Unix socket connections;
PanelGesture request and NavigationGesture broadcast for compositor gestures
- weft-runtime: weft:app/ipc, weft:app/fetch, weft:app/notifications WIT
interfaces; IpcState non-blocking Unix socket host functions; ureq-backed
net:fetch host function (net-fetch feature); notify-send notifications host
- weft-file-portal: spawn a thread per accepted connection for concurrent access
- weft-app-shell: weft-system:// URL translation; WEFT UI Kit UserScript
injection; resolve_weft_system_url helper
- weft-servo-shell: forward compositor navigation gestures to weft-appd
WebSocket as PanelGesture; WEFT UI Kit UserScript injection
- infra/shell: weft-ui-kit.js with 11 custom elements (weft-button, weft-card,
weft-dialog, weft-icon, weft-list, weft-list-item, weft-menu, weft-menu-item,
weft-progress, weft-input, weft-label); system-ui.html handles
NAVIGATION_GESTURE messages and dispatches weft:navigation-gesture CustomEvent
- infra/systemd: add missing env vars to weft-appd.service; correct
servo-shell.service binary path and system-ui.html argument
- .github/workflows/ci.yml: exclude weft-servo-shell and weft-app-shell from
cross-platform job; add them to linux-only job with libsystemd-dev dependency
2026-03-12 11:49:45 +00:00
|
|
|
state.weft_shell_state.retain_alive_panels();
|
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 19:56:35 +00:00
|
|
|
}
|
|
|
|
|
WinitEvent::Input(input_event) => {
|
|
|
|
|
input::process_input_event(state, input_event);
|
|
|
|
|
}
|
2026-03-10 20:09:54 +00:00
|
|
|
WinitEvent::Redraw => {
|
|
|
|
|
let size = backend.window_size();
|
|
|
|
|
let full_damage = Rectangle::from_size(size);
|
|
|
|
|
|
2026-03-13 12:56:57 +00:00
|
|
|
let render_ok = match backend.bind() {
|
|
|
|
|
Ok((renderer, mut framebuffer)) => smithay::desktop::space::render_output::<
|
2026-03-10 20:09:54 +00:00
|
|
|
_,
|
|
|
|
|
WaylandSurfaceRenderElement<GlesRenderer>,
|
|
|
|
|
_,
|
|
|
|
|
_,
|
|
|
|
|
>(
|
|
|
|
|
&output,
|
|
|
|
|
renderer,
|
|
|
|
|
&mut framebuffer,
|
|
|
|
|
1.0,
|
|
|
|
|
0,
|
|
|
|
|
[&state.space],
|
|
|
|
|
&[],
|
|
|
|
|
&mut damage_tracker,
|
|
|
|
|
[0.1_f32, 0.1, 0.1, 1.0],
|
|
|
|
|
)
|
2026-03-13 12:56:57 +00:00
|
|
|
.map_err(|e| tracing::warn!(?e, "render_output failed"))
|
|
|
|
|
.is_ok(),
|
|
|
|
|
Err(e) => {
|
|
|
|
|
tracing::warn!(?e, "backend bind failed");
|
|
|
|
|
false
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
if render_ok {
|
|
|
|
|
if let Err(e) = backend.submit(Some(&[full_damage])) {
|
|
|
|
|
tracing::warn!(?e, "backend submit failed");
|
|
|
|
|
}
|
2026-03-10 20:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state.space.elements().for_each(|window| {
|
|
|
|
|
window.send_frame(
|
|
|
|
|
&output,
|
|
|
|
|
start_time.elapsed(),
|
|
|
|
|
Some(Duration::ZERO),
|
|
|
|
|
|_, _| Some(output.clone()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
state.space.refresh();
|
|
|
|
|
state.popups.cleanup();
|
|
|
|
|
let _ = state.display_handle.flush_clients();
|
|
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
// Request next redraw to drive continuous rendering.
|
2026-03-10 20:09:54 +00:00
|
|
|
backend.window().request_redraw();
|
|
|
|
|
}
|
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 19:56:35 +00:00
|
|
|
WinitEvent::CloseRequested => {
|
|
|
|
|
state.running = false;
|
2026-03-10 20:09:54 +00:00
|
|
|
state.loop_signal.stop();
|
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 19:56:35 +00:00
|
|
|
}
|
2026-03-10 20:09:54 +00:00
|
|
|
_ => (),
|
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 19:56:35 +00:00
|
|
|
})
|
2026-03-10 20:09:54 +00:00
|
|
|
.map_err(|e| anyhow::anyhow!("winit source insertion failed: {e}"))?;
|
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 19:56:35 +00:00
|
|
|
|
2026-03-10 20:20:28 +00:00
|
|
|
event_loop.run(None, &mut state, |_| {})?;
|
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 19:56:35 +00:00
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|