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::input::{
|
2026-03-10 22:43:43 +00:00
|
|
|
AbsolutePositionEvent, Axis, AxisSource, ButtonState, Event, GestureBeginEvent,
|
|
|
|
|
GestureEndEvent, GesturePinchUpdateEvent, GestureSwipeUpdateEvent, InputBackend,
|
|
|
|
|
InputEvent, KeyboardKeyEvent, PointerAxisEvent, PointerButtonEvent, PointerMotionEvent,
|
|
|
|
|
TouchEvent,
|
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
|
|
|
},
|
|
|
|
|
input::{
|
2026-03-10 20:20:28 +00:00
|
|
|
keyboard::FilterResult,
|
|
|
|
|
pointer::{AxisFrame, ButtonEvent, MotionEvent},
|
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 22:43:43 +00:00
|
|
|
utils::{Logical, Point, SERIAL_COUNTER},
|
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 crate::state::WeftCompositorState;
|
|
|
|
|
|
2026-03-10 20:24:23 +00:00
|
|
|
pub fn process_input_event<B: InputBackend>(state: &mut WeftCompositorState, event: InputEvent<B>) {
|
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
|
|
|
match event {
|
2026-03-10 22:43:43 +00:00
|
|
|
InputEvent::Keyboard { event } => handle_keyboard::<B>(state, event),
|
|
|
|
|
InputEvent::PointerMotion { event } => handle_pointer_motion::<B>(state, event),
|
|
|
|
|
InputEvent::PointerMotionAbsolute { event } => {
|
|
|
|
|
handle_pointer_motion_absolute::<B>(state, event)
|
|
|
|
|
}
|
|
|
|
|
InputEvent::PointerButton { event } => handle_pointer_button::<B>(state, event),
|
|
|
|
|
InputEvent::PointerAxis { event } => handle_pointer_axis::<B>(state, event),
|
|
|
|
|
InputEvent::TouchDown { event } => handle_touch_down::<B>(state, event),
|
|
|
|
|
InputEvent::TouchUp { event } => handle_touch_up::<B>(state, event),
|
|
|
|
|
InputEvent::TouchMotion { event } => handle_touch_motion::<B>(state, event),
|
|
|
|
|
InputEvent::TouchFrame { event } => handle_touch_frame::<B>(state, event),
|
|
|
|
|
InputEvent::TouchCancel { event } => handle_touch_cancel::<B>(state, event),
|
|
|
|
|
InputEvent::GestureSwipeBegin { event } => handle_gesture_swipe_begin::<B>(state, event),
|
|
|
|
|
InputEvent::GestureSwipeUpdate { event } => handle_gesture_swipe_update::<B>(state, event),
|
|
|
|
|
InputEvent::GestureSwipeEnd { event } => handle_gesture_swipe_end::<B>(state, event),
|
|
|
|
|
InputEvent::GesturePinchBegin { event } => handle_gesture_pinch_begin::<B>(state, event),
|
|
|
|
|
InputEvent::GesturePinchUpdate { event } => handle_gesture_pinch_update::<B>(state, event),
|
|
|
|
|
InputEvent::GesturePinchEnd { event } => handle_gesture_pinch_end::<B>(state, event),
|
|
|
|
|
InputEvent::GestureHoldBegin { event } => handle_gesture_hold_begin::<B>(state, event),
|
|
|
|
|
InputEvent::GestureHoldEnd { event } => handle_gesture_hold_end::<B>(state, event),
|
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
|
|
|
// Device added/removed events are handled at the backend level.
|
|
|
|
|
InputEvent::DeviceAdded { .. } | InputEvent::DeviceRemoved { .. } => {}
|
|
|
|
|
_ => {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 20:24:23 +00:00
|
|
|
fn handle_keyboard<B: InputBackend>(state: &mut WeftCompositorState, event: B::KeyboardKeyEvent) {
|
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 serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
let time = event.time_msec();
|
|
|
|
|
let key_state = event.state();
|
|
|
|
|
|
|
|
|
|
if let Some(keyboard) = state.seat.get_keyboard() {
|
2026-10-09 16:22:59 +00:00
|
|
|
// Alt+F4 belongs to the compositor: it asks the focused application
|
|
|
|
|
// window to close, and the key never reaches a client.
|
|
|
|
|
let close = keyboard.input::<bool, _>(
|
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
|
|
|
state,
|
|
|
|
|
event.key_code(),
|
|
|
|
|
key_state,
|
|
|
|
|
serial,
|
|
|
|
|
time,
|
2026-10-09 16:29:22 +00:00
|
|
|
|state, mods, keysym| {
|
|
|
|
|
// A release is taken only when its press was, so no client
|
|
|
|
|
// sees half of a key.
|
|
|
|
|
let code = keysym.raw_code().raw();
|
|
|
|
|
if key_state == smithay::backend::input::KeyState::Pressed {
|
|
|
|
|
if mods.alt
|
|
|
|
|
&& keysym.modified_sym() == smithay::input::keyboard::keysyms::KEY_F4.into()
|
|
|
|
|
{
|
|
|
|
|
state.suppressed_keys.push(code);
|
|
|
|
|
return FilterResult::Intercept(true);
|
|
|
|
|
}
|
|
|
|
|
} else if let Some(i) = state.suppressed_keys.iter().position(|&k| k == code) {
|
|
|
|
|
state.suppressed_keys.remove(i);
|
|
|
|
|
return FilterResult::Intercept(false);
|
2026-10-09 16:22:59 +00:00
|
|
|
}
|
2026-10-09 16:29:22 +00:00
|
|
|
FilterResult::Forward
|
2026-10-09 16:22:59 +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-10-09 16:22:59 +00:00
|
|
|
if close == Some(true) {
|
|
|
|
|
state.close_focused_window();
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_pointer_motion<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::PointerMotionEvent,
|
|
|
|
|
) {
|
|
|
|
|
let delta = event.delta();
|
|
|
|
|
state.pointer_location += delta;
|
|
|
|
|
clamp_pointer_to_output_space(state);
|
|
|
|
|
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
let pointer_location = state.pointer_location;
|
|
|
|
|
let under = surface_under(state, pointer_location);
|
|
|
|
|
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.motion(
|
|
|
|
|
state,
|
|
|
|
|
under,
|
|
|
|
|
&MotionEvent {
|
|
|
|
|
location: pointer_location,
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
pointer.frame(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_pointer_motion_absolute<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::PointerMotionAbsoluteEvent,
|
|
|
|
|
) {
|
|
|
|
|
let output = state.space.outputs().next().cloned();
|
|
|
|
|
if let Some(output) = output {
|
2026-03-10 20:24:23 +00:00
|
|
|
let output_geo = state.space.output_geometry(&output).unwrap_or_default();
|
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 pos = event.position_transformed(output_geo.size);
|
|
|
|
|
state.pointer_location = output_geo.loc.to_f64() + pos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
let pointer_location = state.pointer_location;
|
|
|
|
|
let under = surface_under(state, pointer_location);
|
|
|
|
|
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.motion(
|
|
|
|
|
state,
|
|
|
|
|
under,
|
|
|
|
|
&MotionEvent {
|
|
|
|
|
location: pointer_location,
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
pointer.frame(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_pointer_button<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::PointerButtonEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
let button = event.button_code();
|
|
|
|
|
let button_state = event.state();
|
|
|
|
|
|
2026-10-09 15:36:55 +00:00
|
|
|
// On press: activate the window under the pointer, which raises an
|
|
|
|
|
// application window and focuses it.
|
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
|
|
|
if button_state == ButtonState::Pressed {
|
|
|
|
|
let pointer_location = state.pointer_location;
|
2026-10-09 15:36:55 +00:00
|
|
|
let window = state
|
|
|
|
|
.space
|
|
|
|
|
.element_under(pointer_location)
|
|
|
|
|
.map(|(window, _)| window.clone());
|
|
|
|
|
if let Some(window) = window {
|
|
|
|
|
state.activate_window(&window);
|
|
|
|
|
} else if let Some((surface, _loc)) = surface_under(state, pointer_location) {
|
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
|
|
|
if let Some(keyboard) = state.seat.get_keyboard() {
|
2026-03-10 20:31:59 +00:00
|
|
|
keyboard.set_focus(state, Some(surface), serial);
|
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
|
|
|
}
|
|
|
|
|
} else if let Some(keyboard) = state.seat.get_keyboard() {
|
|
|
|
|
keyboard.set_focus(state, None, serial);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.button(
|
|
|
|
|
state,
|
|
|
|
|
&ButtonEvent {
|
|
|
|
|
button,
|
|
|
|
|
state: button_state,
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
pointer.frame(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_pointer_axis<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::PointerAxisEvent,
|
|
|
|
|
) {
|
|
|
|
|
let horizontal = event.amount(Axis::Horizontal);
|
|
|
|
|
let vertical = event.amount(Axis::Vertical);
|
|
|
|
|
let h_discrete = event.amount_v120(Axis::Horizontal);
|
|
|
|
|
let v_discrete = event.amount_v120(Axis::Vertical);
|
|
|
|
|
let source = event.source();
|
|
|
|
|
|
|
|
|
|
let mut frame = AxisFrame::new(event.time_msec()).source(source);
|
|
|
|
|
|
|
|
|
|
if let Some(v) = horizontal {
|
|
|
|
|
if v != 0.0 {
|
|
|
|
|
frame = frame.value(Axis::Horizontal, v);
|
|
|
|
|
}
|
|
|
|
|
if let Some(d) = h_discrete {
|
|
|
|
|
frame = frame.v120(Axis::Horizontal, d as i32);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if let Some(v) = vertical {
|
|
|
|
|
if v != 0.0 {
|
|
|
|
|
frame = frame.value(Axis::Vertical, v);
|
|
|
|
|
}
|
|
|
|
|
if let Some(d) = v_discrete {
|
|
|
|
|
frame = frame.v120(Axis::Vertical, d as i32);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if source == AxisSource::Finger {
|
|
|
|
|
if event.amount(Axis::Horizontal).unwrap_or(0.0) == 0.0 {
|
|
|
|
|
frame = frame.stop(Axis::Horizontal);
|
|
|
|
|
}
|
|
|
|
|
if event.amount(Axis::Vertical).unwrap_or(0.0) == 0.0 {
|
|
|
|
|
frame = frame.stop(Axis::Vertical);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.axis(state, frame);
|
|
|
|
|
pointer.frame(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 20:24:23 +00:00
|
|
|
fn handle_touch_down<B: InputBackend>(state: &mut WeftCompositorState, event: B::TouchDownEvent) {
|
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 serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
let output = state.space.outputs().next().cloned();
|
|
|
|
|
if let Some(output) = output {
|
|
|
|
|
let output_geo = state.space.output_geometry(&output).unwrap_or_default();
|
|
|
|
|
let pos = event.position_transformed(output_geo.size);
|
|
|
|
|
let location = output_geo.loc.to_f64() + pos;
|
|
|
|
|
let under = surface_under(state, location);
|
|
|
|
|
|
|
|
|
|
if let Some(touch) = state.seat.get_touch() {
|
|
|
|
|
touch.down(
|
|
|
|
|
state,
|
|
|
|
|
under,
|
|
|
|
|
&smithay::input::touch::DownEvent {
|
|
|
|
|
slot: event.slot(),
|
|
|
|
|
location,
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-10 20:24:23 +00:00
|
|
|
fn handle_touch_up<B: InputBackend>(state: &mut WeftCompositorState, event: B::TouchUpEvent) {
|
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 serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
if let Some(touch) = state.seat.get_touch() {
|
|
|
|
|
touch.up(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::touch::UpEvent {
|
|
|
|
|
slot: event.slot(),
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_touch_motion<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::TouchMotionEvent,
|
|
|
|
|
) {
|
|
|
|
|
let output = state.space.outputs().next().cloned();
|
|
|
|
|
if let Some(output) = output {
|
|
|
|
|
let output_geo = state.space.output_geometry(&output).unwrap_or_default();
|
|
|
|
|
let pos = event.position_transformed(output_geo.size);
|
|
|
|
|
let location = output_geo.loc.to_f64() + pos;
|
|
|
|
|
let under = surface_under(state, location);
|
|
|
|
|
|
|
|
|
|
if let Some(touch) = state.seat.get_touch() {
|
|
|
|
|
touch.motion(
|
|
|
|
|
state,
|
|
|
|
|
under,
|
|
|
|
|
&smithay::input::touch::MotionEvent {
|
|
|
|
|
slot: event.slot(),
|
|
|
|
|
location,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_touch_frame<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
_event: B::TouchFrameEvent,
|
|
|
|
|
) {
|
|
|
|
|
if let Some(touch) = state.seat.get_touch() {
|
|
|
|
|
touch.frame(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_touch_cancel<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
_event: B::TouchCancelEvent,
|
|
|
|
|
) {
|
|
|
|
|
if let Some(touch) = state.seat.get_touch() {
|
|
|
|
|
touch.cancel(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
const NAVIGATION_SWIPE_FINGERS: u32 = 3;
|
|
|
|
|
const NAVIGATION_SWIPE_THRESHOLD: f64 = 100.0;
|
|
|
|
|
|
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
|
|
|
fn handle_gesture_swipe_begin<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GestureSwipeBeginEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
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
|
|
|
let fingers = event.fingers();
|
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
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_swipe_begin(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GestureSwipeBeginEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
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
|
|
|
fingers,
|
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
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
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.gesture_state.in_progress = true;
|
|
|
|
|
state.gesture_state.fingers = fingers;
|
|
|
|
|
state.gesture_state.dx = 0.0;
|
|
|
|
|
state.gesture_state.dy = 0.0;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_swipe_update<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GestureSwipeUpdateEvent,
|
|
|
|
|
) {
|
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
|
|
|
let delta = event.delta();
|
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
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_swipe_update(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GestureSwipeUpdateEvent {
|
|
|
|
|
time: event.time_msec(),
|
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
|
|
|
delta,
|
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
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
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
|
|
|
if state.gesture_state.in_progress {
|
|
|
|
|
state.gesture_state.dx += delta.x;
|
|
|
|
|
state.gesture_state.dy += delta.y;
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_swipe_end<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GestureSwipeEndEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
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
|
|
|
let cancelled = event.cancelled();
|
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
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_swipe_end(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GestureSwipeEndEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
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
|
|
|
cancelled,
|
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
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
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
|
|
|
let gs = std::mem::take(&mut state.gesture_state);
|
|
|
|
|
if !cancelled
|
|
|
|
|
&& gs.in_progress
|
|
|
|
|
&& gs.fingers >= NAVIGATION_SWIPE_FINGERS
|
2026-03-13 09:38:01 +00:00
|
|
|
&& (gs.dx.abs() >= NAVIGATION_SWIPE_THRESHOLD || gs.dy.abs() >= NAVIGATION_SWIPE_THRESHOLD)
|
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
|
|
|
|
|
.send_navigation_gesture_to_panels(0, gs.fingers, gs.dx, gs.dy);
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_pinch_begin<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GesturePinchBeginEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_pinch_begin(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GesturePinchBeginEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
fingers: event.fingers(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_pinch_update<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GesturePinchUpdateEvent,
|
|
|
|
|
) {
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_pinch_update(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GesturePinchUpdateEvent {
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
delta: event.delta(),
|
|
|
|
|
scale: event.scale(),
|
|
|
|
|
rotation: event.rotation(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_pinch_end<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GesturePinchEndEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_pinch_end(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GesturePinchEndEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
cancelled: event.cancelled(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_hold_begin<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GestureHoldBeginEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_hold_begin(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GestureHoldBeginEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
fingers: event.fingers(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn handle_gesture_hold_end<B: InputBackend>(
|
|
|
|
|
state: &mut WeftCompositorState,
|
|
|
|
|
event: B::GestureHoldEndEvent,
|
|
|
|
|
) {
|
|
|
|
|
let serial = SERIAL_COUNTER.next_serial();
|
|
|
|
|
if let Some(pointer) = state.seat.get_pointer() {
|
|
|
|
|
pointer.gesture_hold_end(
|
|
|
|
|
state,
|
|
|
|
|
&smithay::input::pointer::GestureHoldEndEvent {
|
|
|
|
|
serial,
|
|
|
|
|
time: event.time_msec(),
|
|
|
|
|
cancelled: event.cancelled(),
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Returns the surface and its local coordinates under the given position.
|
|
|
|
|
pub fn surface_under(
|
|
|
|
|
state: &WeftCompositorState,
|
|
|
|
|
point: Point<f64, Logical>,
|
2026-03-10 20:24:23 +00:00
|
|
|
) -> Option<(
|
|
|
|
|
smithay::reexports::wayland_server::protocol::wl_surface::WlSurface,
|
|
|
|
|
Point<f64, Logical>,
|
|
|
|
|
)> {
|
|
|
|
|
state.space.element_under(point).and_then(|(window, loc)| {
|
|
|
|
|
window
|
|
|
|
|
.surface_under(
|
|
|
|
|
point - loc.to_f64(),
|
|
|
|
|
smithay::desktop::WindowSurfaceType::ALL,
|
|
|
|
|
)
|
|
|
|
|
.map(|(surface, surface_loc)| (surface, (loc.to_f64() + surface_loc.to_f64())))
|
|
|
|
|
})
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn clamp_pointer_to_output_space(state: &mut WeftCompositorState) {
|
|
|
|
|
let bbox = state
|
|
|
|
|
.space
|
|
|
|
|
.outputs()
|
|
|
|
|
.filter_map(|o| state.space.output_geometry(o))
|
|
|
|
|
.fold(
|
|
|
|
|
smithay::utils::Rectangle::<i32, Logical>::default(),
|
|
|
|
|
|acc, r| acc.merge(r),
|
|
|
|
|
);
|
|
|
|
|
if bbox.size.w > 0 && bbox.size.h > 0 {
|
|
|
|
|
state.pointer_location.x = state
|
|
|
|
|
.pointer_location
|
|
|
|
|
.x
|
|
|
|
|
.clamp(bbox.loc.x as f64, (bbox.loc.x + bbox.size.w - 1) as f64);
|
|
|
|
|
state.pointer_location.y = state
|
|
|
|
|
.pointer_location
|
|
|
|
|
.y
|
|
|
|
|
.clamp(bbox.loc.y as f64, (bbox.loc.y + bbox.size.h - 1) as f64);
|
|
|
|
|
}
|
|
|
|
|
}
|