@@ -195,6 +195,7 @@ impl PointerHandler for WinitState {
195195 // Get the current phase.
196196 let mut pointer_data = pointer. winit_data ( ) . inner . lock ( ) . unwrap ( ) ;
197197
198+ let has_value120_scroll = horizontal. value120 != 0 || vertical. value120 != 0 ;
198199 let has_discrete_scroll = horizontal. discrete != 0 || vertical. discrete != 0 ;
199200
200201 // Figure out what to do about start/ended phases here.
@@ -206,7 +207,7 @@ impl PointerHandler for WinitState {
206207 } else {
207208 match pointer_data. phase {
208209 // Discrete scroll only results in moved events.
209- _ if has_discrete_scroll => TouchPhase :: Moved ,
210+ _ if has_value120_scroll || has_discrete_scroll => TouchPhase :: Moved ,
210211 TouchPhase :: Started | TouchPhase :: Moved => TouchPhase :: Moved ,
211212 _ => TouchPhase :: Started ,
212213 }
@@ -217,7 +218,13 @@ impl PointerHandler for WinitState {
217218
218219 // Mice events have both pixel and discrete delta's at the same time. So prefer
219220 // the discrete values if they are present.
220- let delta = if has_discrete_scroll {
221+ let delta = if has_value120_scroll {
222+ // NOTE: Wayland sign convention is the inverse of winit.
223+ MouseScrollDelta :: LineDelta (
224+ ( -horizontal. value120 ) as f32 / 120. ,
225+ ( -vertical. value120 ) as f32 / 120. ,
226+ )
227+ } else if has_discrete_scroll {
221228 // NOTE: Wayland sign convention is the inverse of winit.
222229 MouseScrollDelta :: LineDelta (
223230 ( -horizontal. discrete ) as f32 ,
0 commit comments