aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamses <ramses@well-founded.dev>2024-11-11 07:08:29 +0100
committerGitHub <noreply@github.com>2024-11-11 06:08:29 +0000
commit494b438151c6ae94821ebfc612f12a0e1d49229e (patch)
tree7273c574140c826d2420a114f573b005273eea2f
parent010a2368823bc3959c1468609cd05367e5b6d0b6 (diff)
downloadniri-494b438151c6ae94821ebfc612f12a0e1d49229e.tar.gz
niri-494b438151c6ae94821ebfc612f12a0e1d49229e.tar.bz2
niri-494b438151c6ae94821ebfc612f12a0e1d49229e.zip
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 <yalterz@gmail.com>
-rw-r--r--src/input/mod.rs6
1 files changed, 6 insertions, 0 deletions
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<I: InputBackend>(&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);