input: Only send axis_stop when amount is present
Browse files at this commitc7a7b2daf29565a736f7e895230daeb9f18b7610Parent: 180d07a1 changed file +9 -4
- src/input.rs +9 -4
src/input.rsmodified+9 -4
| @@ -455,16 +455,21 @@ impl State { | |||
| 455 | if let Some(discrete) = horizontal_amount_discrete { | 455 | if let Some(discrete) = horizontal_amount_discrete { |
| 456 | frame = frame.discrete(Axis::Horizontal, discrete as i32); | 456 | frame = frame.discrete(Axis::Horizontal, discrete as i32); |
| 457 | } | 457 | } |
| 458 | - } else if source == AxisSource::Finger { | ||
| 459 | - frame = frame.stop(Axis::Horizontal); | ||
| 460 | } | 458 | } |
| 461 | if vertical_amount != 0.0 { | 459 | if vertical_amount != 0.0 { |
| 462 | frame = frame.value(Axis::Vertical, vertical_amount); | 460 | frame = frame.value(Axis::Vertical, vertical_amount); |
| 463 | if let Some(discrete) = vertical_amount_discrete { | 461 | if let Some(discrete) = vertical_amount_discrete { |
| 464 | frame = frame.discrete(Axis::Vertical, discrete as i32); | 462 | frame = frame.discrete(Axis::Vertical, discrete as i32); |
| 465 | } | 463 | } |
| 466 | - } else if source == AxisSource::Finger { | 464 | + } |
| 467 | - frame = frame.stop(Axis::Vertical); | 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 | + } | ||
| 468 | } | 473 | } |
| 469 | 474 | ||
| 470 | self.niri.seat.get_pointer().unwrap().axis(self, frame); | 475 | self.niri.seat.get_pointer().unwrap().axis(self, frame); |