aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/input.rs b/src/input.rs
index ec3f9afd..3dfe7ae6 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -455,16 +455,21 @@ impl State {
if let Some(discrete) = horizontal_amount_discrete {
frame = frame.discrete(Axis::Horizontal, discrete as i32);
}
- } else if source == AxisSource::Finger {
- frame = frame.stop(Axis::Horizontal);
}
if vertical_amount != 0.0 {
frame = frame.value(Axis::Vertical, vertical_amount);
if let Some(discrete) = vertical_amount_discrete {
frame = frame.discrete(Axis::Vertical, discrete as i32);
}
- } else if source == AxisSource::Finger {
- frame = frame.stop(Axis::Vertical);
+ }
+
+ if source == AxisSource::Finger {
+ if event.amount(Axis::Horizontal) == Some(0.0) {
+ frame = frame.stop(Axis::Horizontal);
+ }
+ if event.amount(Axis::Vertical) == Some(0.0) {
+ frame = frame.stop(Axis::Vertical);
+ }
}
self.niri.seat.get_pointer().unwrap().axis(self, frame);