From 494b438151c6ae94821ebfc612f12a0e1d49229e Mon Sep 17 00:00:00 2001 From: Ramses Date: Mon, 11 Nov 2024 07:08:29 +0100 Subject: Unhide the pointer on scroll events (#797) * Unhide the pointer on scroll events Since we reset the surface under the pointer when we hide the pointer (see update_pointer_contents), scroll events don't work when the pointer is hidden. So to make scrolling work, we make sure that we unhide the pointer when a scrolling event occurs. * Update src/input/mod.rs --------- Co-authored-by: Ivan Molodetskikh --- src/input/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/input') diff --git a/src/input/mod.rs b/src/input/mod.rs index a8487d14..0bff4637 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1744,6 +1744,12 @@ impl State { fn on_pointer_axis(&mut self, event: I::PointerAxisEvent) { let source = event.source(); + // We received an event for the regular pointer, so show it now. This is also needed for + // update_pointer_contents() below to return the real contents, necessary for the pointer + // axis event to reach the window. + self.niri.pointer_hidden = false; + self.niri.tablet_cursor_location = None; + let horizontal_amount_v120 = event.amount_v120(Axis::Horizontal); let vertical_amount_v120 = event.amount_v120(Axis::Vertical); -- cgit