diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-02 08:44:29 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-06 10:57:12 -0700 |
| commit | 83aec41df31100df0b0ab553ac9220d03bd01bba (patch) | |
| tree | 99ffbe3853d7852e2cdea67c938ca6a6b223a979 /src/input.rs | |
| parent | 8be938197486acb2af4ba91aae0fac57619a46c8 (diff) | |
| download | niri-83aec41df31100df0b0ab553ac9220d03bd01bba.tar.gz niri-83aec41df31100df0b0ab553ac9220d03bd01bba.tar.bz2 niri-83aec41df31100df0b0ab553ac9220d03bd01bba.zip | |
Hide pointer on touch interaction
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index f8b753b8..2fd03a64 100644 --- a/src/input.rs +++ b/src/input.rs @@ -822,6 +822,7 @@ impl State { let mut new_pos = pos + event.delta(); // We received an event for the regular pointer, so show it now. + self.niri.pointer_hidden = false; self.niri.tablet_cursor_location = None; // Check if we have an active pointer constraint. @@ -1035,6 +1036,9 @@ impl State { pointer.frame(self); + // We moved the pointer, show it. + self.niri.pointer_hidden = false; + // We moved the regular pointer, so show it now. self.niri.tablet_cursor_location = None; @@ -1333,6 +1337,7 @@ impl State { event.time_msec(), ); + self.niri.pointer_hidden = false; self.niri.tablet_cursor_location = Some(pos); } @@ -1398,6 +1403,7 @@ impl State { event.time_msec(), ); } + self.niri.pointer_hidden = false; self.niri.tablet_cursor_location = Some(pos); } ProximityState::Out => { @@ -1735,6 +1741,9 @@ impl State { time: evt.time_msec(), }, ); + + // We're using touch, hide the pointer. + self.niri.pointer_hidden = true; } fn on_touch_up<I: InputBackend>(&mut self, evt: I::TouchUpEvent) { let Some(handle) = self.niri.seat.get_touch() else { |
