forge
Explore
Log in

Don't you dare go Hollow

input: Only send axis_stop when amount is present

Browse files at this commit

c7a7b2daf29565a736f7e895230daeb9f18b7610Ivan MolodetskikhParent: 180d07a
This is the expected behavior. Unbreaks Alacritty scrolling.
src/input.rsmodified+9 -4
@@ -455,16 +455,21 @@ impl State {
455455 if let Some(discrete) = horizontal_amount_discrete {
456456 frame = frame.discrete(Axis::Horizontal, discrete as i32);
457457 }
458- } else if source == AxisSource::Finger {
459- frame = frame.stop(Axis::Horizontal);
460458 }
461459 if vertical_amount != 0.0 {
462460 frame = frame.value(Axis::Vertical, vertical_amount);
463461 if let Some(discrete) = vertical_amount_discrete {
464462 frame = frame.discrete(Axis::Vertical, discrete as i32);
465463 }
466- } else if source == AxisSource::Finger {
467- frame = frame.stop(Axis::Vertical);
464+ }
465+
466+ if source == AxisSource::Finger {
467+ if event.amount(Axis::Horizontal) == Some(0.0) {
468+ frame = frame.stop(Axis::Horizontal);
469+ }
470+ if event.amount(Axis::Vertical) == Some(0.0) {
471+ frame = frame.stop(Axis::Vertical);
472+ }
468473 }
469474
470475 self.niri.seat.get_pointer().unwrap().axis(self, frame);