forge
Explore
Log in

Don't you dare go Hollow

Unhide the pointer on scroll events (#797)

Browse files at this commit

494b438151c6ae94821ebfc612f12a0e1d49229eUnverifiedRamses and Ivan MolodetskikhParent: 010a236
* 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

---------
src/input/mod.rsmodified+6 -0
@@ -1744,6 +1744,12 @@ impl State {
17441744 fn on_pointer_axis<I: InputBackend>(&mut self, event: I::PointerAxisEvent) {
17451745 let source = event.source();
17461746
1747+ // We received an event for the regular pointer, so show it now. This is also needed for
1748+ // update_pointer_contents() below to return the real contents, necessary for the pointer
1749+ // axis event to reach the window.
1750+ self.niri.pointer_hidden = false;
1751+ self.niri.tablet_cursor_location = None;
1752+
17471753 let horizontal_amount_v120 = event.amount_v120(Axis::Horizontal);
17481754 let vertical_amount_v120 = event.amount_v120(Axis::Vertical);
17491755