diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-06 14:51:37 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-06 14:51:37 +0400 |
| commit | c7a7b2daf29565a736f7e895230daeb9f18b7610 (patch) | |
| tree | 2bd203bcd74f3d167de1aed1bd8d307038c2fc26 /src/input.rs | |
| parent | 180d07aab9b96a6b6794561a42ce1a7ad246d989 (diff) | |
| download | niri-c7a7b2daf29565a736f7e895230daeb9f18b7610.tar.gz niri-c7a7b2daf29565a736f7e895230daeb9f18b7610.tar.bz2 niri-c7a7b2daf29565a736f7e895230daeb9f18b7610.zip | |
input: Only send axis_stop when amount is present
This is the expected behavior. Unbreaks Alacritty scrolling.
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 13 |
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); |
