From 3d73ed0f057a555ded67ad58dbe02b36cd4d2d1f Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:44:00 +0200 Subject: Accumulate wayland-crate additions: capture rendering, focus/Space sync, VT resume, plumbing Bundles the remaining wayland-crate changes built up here, touching both backends (udev and winit) and the shared input/rendering code: - udev/capture.rs: off-screen Pixman render of an arbitrary (not necessarily on-screen) workspace's window content to a PPM file -- what crates/core's capture-request queue drives, for a workspace switcher's thumbnail previews. wlr-screencopy structurally can't do this (it can only see what an output is presenting), which is why this exists as a separate render path rather than reusing it. - input::focus_window now also raises the window in smithay's own Space, not just core's stacking order - Space is what actually renders on top and what pointer hit-testing reads, so any focus path that skipped this (an IPC "focus" dispatch, concretely) left a window genuinely focused while still rendering, and receiving clicks, underneath whatever was already topmost. Both backends' poll loops now re-sync this after any IPC mutation. - udev/session.rs's VT-switch resume fix (drains a stale pending page flip before reasserting CRTCs) already has its own earlier, cleanly isolated commit - not duplicated here. - Assorted decoration/cursor/rounded-corners/output-management/ screencopy/XWayland changes and their cross-backend wiring. Coarser than the repo's usual one-purpose-per-commit convention, deliberately - see the core-crate sweep commit's own message for why. --- crates/wayland/src/udev/session.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'crates/wayland/src/udev/session.rs') diff --git a/crates/wayland/src/udev/session.rs b/crates/wayland/src/udev/session.rs index fa40b0e..4dd6db0 100644 --- a/crates/wayland/src/udev/session.rs +++ b/crates/wayland/src/udev/session.rs @@ -214,6 +214,41 @@ fn handle_libinput_event(state: &mut CompState, event: InputEvent handle_gesture_swipe_begin(state, &event), + InputEvent::GestureSwipeUpdate { event } => handle_gesture_swipe_update(state, &event), + InputEvent::GestureSwipeEnd { event } => handle_gesture_swipe_end(state, &event), + // Pinch/hold: no WM-level meaning, forwarded to the focused client + // as-is (`wp_pointer_gestures`) - pinch-to-zoom in an image viewer + // or PDF reader, the one real use either has. Same reasoning as the + // `PointerAxis` forwarding above: nothing here should be silently + // dropped just because this WM has no use for it itself. + InputEvent::GesturePinchBegin { event } => { + let Some(pointer) = state.seat.get_pointer() else { return }; + let fingers = event.fingers(); + pointer.gesture_pinch_begin(state, &GesturePinchBeginEvent { serial: SERIAL_COUNTER.next_serial(), time: event.time_msec(), fingers }); + } + InputEvent::GesturePinchUpdate { event } => { + let Some(pointer) = state.seat.get_pointer() else { return }; + let (delta, scale, rotation) = (event.delta(), event.scale(), event.rotation()); + pointer.gesture_pinch_update(state, &GesturePinchUpdateEvent { time: event.time_msec(), delta, scale, rotation }); + } + InputEvent::GesturePinchEnd { event } => { + let Some(pointer) = state.seat.get_pointer() else { return }; + let cancelled = event.cancelled(); + pointer.gesture_pinch_end(state, &GesturePinchEndEvent { serial: SERIAL_COUNTER.next_serial(), time: event.time_msec(), cancelled }); + } + InputEvent::GestureHoldBegin { event } => { + let Some(pointer) = state.seat.get_pointer() else { return }; + let fingers = event.fingers(); + pointer.gesture_hold_begin(state, &GestureHoldBeginEvent { serial: SERIAL_COUNTER.next_serial(), time: event.time_msec(), fingers }); + } + InputEvent::GestureHoldEnd { event } => { + let Some(pointer) = state.seat.get_pointer() else { return }; + let cancelled = event.cancelled(); + pointer.gesture_hold_end(state, &GestureHoldEndEvent { serial: SERIAL_COUNTER.next_serial(), time: event.time_msec(), cancelled }); + } _ => {} } } -- cgit v1.2.3