From 861b7326715ff529dc26de44704051c61496f87a Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 19 Jun 2026 18:38:58 -0700 Subject: [PATCH] input: Handle scroll events that only have `amount_v120` X11, winit, and libei backends all can produce scroll events with `amount_v120()` but no `amount()`. --- src/input/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/input/mod.rs b/src/input/mod.rs index f323cf4a..d7dbeb20 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -968,7 +968,10 @@ impl State { } } else { let mut frame = AxisFrame::new(event.time_msec()).source(event.source()); - if let Some(horizontal_amount) = event.amount(Axis::Horizontal) { + let horizontal_amount = event + .amount(Axis::Horizontal) + .or_else(|| Some(event.amount_v120(Axis::Horizontal)? * 15.0 / 120.)); + if let Some(horizontal_amount) = horizontal_amount { if horizontal_amount != 0.0 { frame = frame .relative_direction( @@ -986,7 +989,10 @@ impl State { frame = frame.stop(Axis::Horizontal); } } - if let Some(vertical_amount) = event.amount(Axis::Vertical) { + let vertical_amount = event + .amount(Axis::Vertical) + .or_else(|| Some(event.amount_v120(Axis::Vertical)? * 15.0 / 120.)); + if let Some(vertical_amount) = vertical_amount { if vertical_amount != 0.0 { frame = frame .relative_direction(