From 7886ff9acdbc4961359725536c1a15e2cbb3d4f5 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 2 Mar 2016 16:13:13 -0800 Subject: Add phases to wheel events. Needed for apps to support overscroll on the Mac. --- src/api/x11/input.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/api/x11') diff --git a/src/api/x11/input.rs b/src/api/x11/input.rs index 2ebc989..a05b22e 100644 --- a/src/api/x11/input.rs +++ b/src/api/x11/input.rs @@ -201,7 +201,7 @@ impl XInputEventHandler { } else { -1.0 }; - Some(MouseWheel(LineDelta(0.0, delta))) + Some(MouseWheel(LineDelta(0.0, delta), TouchPhase::Moved)) } else { // emulated button event from a touch/smooth-scroll // event. Ignore these events and handle scrolling @@ -235,7 +235,8 @@ impl XInputEventHandler { } if scroll_delta.0.abs() > 0.0 || scroll_delta.1.abs() > 0.0 { - Some(MouseWheel(LineDelta(scroll_delta.0 as f32, scroll_delta.1 as f32))) + Some(MouseWheel(LineDelta(scroll_delta.0 as f32, scroll_delta.1 as f32), + TouchPhase::Moved)) } else { let new_cursor_pos = (event_data.event_x, event_data.event_y); if new_cursor_pos != self.current_state.cursor_pos { -- cgit v1.2.3