atagen

monolith

public
Star0
Watch0

Commit 0d95cbee63c2

tarball

atagen <boss@atagen.co>2026-10-19 07:54 UTC

1 file changed+8-1
input: reset the cursor when pointer focus moves to another client

Clients only set the cursor on enter, so a hidden or custom cursor from one client stayed on screen over gaps and over clients that never set one.
Modified file: crates/monolith/src/input.rs+8 additions−1 deletions
@@ -6,7 +6,8 @@ use monolith_layout::{Rect, WindowId};
66 use smithay::backend::input::{ButtonState, InputTime, KeyState};
77 use smithay::backend::session::Session;
88 use smithay::input::keyboard::{FilterResult, Keycode, xkb};
9-use smithay::input::pointer::{AxisFrame, ButtonEvent, MotionEvent};
9+use smithay::input::pointer::{AxisFrame, ButtonEvent, CursorImageStatus, MotionEvent};
10+use smithay::reexports::wayland_server::Resource;
1011 use smithay::utils::{Logical, Point, SERIAL_COUNTER};
1112 use smithay::wayland::shell::wlr_layer::Layer;
1213
@@ -22,6 +23,7 @@ impl State {
2223 };
2324 focus_on_hover(self, pos, self.input.warping);
2425 let under = self.surface_under(pos);
26+ let before = pointer.current_focus().and_then(|s| s.client());
2527 pointer.motion(
2628 self,
2729 under,
@@ -31,6 +33,11 @@ impl State {
3133 time,
3234 },
3335 );
36+ let after = pointer.current_focus().and_then(|s| s.client());
37+ if before.map(|c| c.id()) != after.map(|c| c.id()) {
38+ self.input.cursor_status = CursorImageStatus::default_named();
39+ self.dirty.redraw = true;
40+ }
3441 }
3542
3643 pub fn pointer_button(&mut self, button: u32, pressed: ButtonState, time: InputTime) {