From 0a4c4b5941fe982ccb3d3175e26d9d83f0025ffd Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:56:00 +0200 Subject: Checkpoint: preserve all uncommitted rust-rewrite worktree work Safety commit before reconciling this worktree with main, which has diverged with its own separate fixes today. Nothing here is reviewed or curated yet - this exists purely so none of this work can be lost to a git operation, disk issue, or worktree cleanup while that reconciliation happens. --- crates/wayland/src/protocols/seat.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 crates/wayland/src/protocols/seat.rs (limited to 'crates/wayland/src/protocols/seat.rs') diff --git a/crates/wayland/src/protocols/seat.rs b/crates/wayland/src/protocols/seat.rs new file mode 100644 index 0000000..bd7ae4c --- /dev/null +++ b/crates/wayland/src/protocols/seat.rs @@ -0,0 +1,31 @@ +//! `wl_seat`: keyboard/pointer/touch focus types and the client-set cursor +//! image. + +use smithay::input::pointer::CursorImageStatus; +use smithay::input::{Seat, SeatHandler, SeatState}; +use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; + +use crate::state::CompState; + +impl SeatHandler for CompState { + type KeyboardFocus = WlSurface; + type PointerFocus = WlSurface; + type TouchFocus = WlSurface; + + fn seat_state(&mut self) -> &mut SeatState { + &mut self.seat_state + } + + fn focus_changed(&mut self, _seat: &Seat, _focused: Option<&WlSurface>) {} + /// Clients set their own cursor (an I-beam over text, a hand over a + /// link). Recorded here and drawn by the render paths - on a bare TTY + /// nothing else would draw it. See `cursor.rs`. + fn cursor_image(&mut self, _seat: &Seat, image: CursorImageStatus) { + self.cursor_status = image; + // The client has now explicitly claimed the cursor - see + // `decoration_cursor_active`'s own doc comment and `input.rs:: + // update_cursor_shape` for why this has to be tracked separately + // from just overwriting `cursor_status`. + self.decoration_cursor_active = false; + } +} -- cgit v1.2.3