srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/protocols/seat.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-02-15 14:56:00 +0200
committersrdusr <[email protected]>2025-02-15 14:56:00 +0200
commit0a4c4b5941fe982ccb3d3175e26d9d83f0025ffd (patch)
tree7672d0af277664f457c6c9462925c0005fe35dcf /crates/wayland/src/protocols/seat.rs
parent413daa7ba2ea0ebd1424c024fd0566423aaea3f8 (diff)
downloadsrdwm-0a4c4b5941fe982ccb3d3175e26d9d83f0025ffd.tar.gz
srdwm-0a4c4b5941fe982ccb3d3175e26d9d83f0025ffd.zip
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.
Diffstat (limited to 'crates/wayland/src/protocols/seat.rs')
-rw-r--r--crates/wayland/src/protocols/seat.rs31
1 files changed, 31 insertions, 0 deletions
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<Self> {
+ &mut self.seat_state
+ }
+
+ fn focus_changed(&mut self, _seat: &Seat<Self>, _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<Self>, 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;
+ }
+}