aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/x11
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/x11')
-rw-r--r--src/api/x11/window.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs
index 9a6f6a8..ba0fe52 100644
--- a/src/api/x11/window.rs
+++ b/src/api/x11/window.rs
@@ -219,6 +219,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
use events::Event::{MouseInput, MouseWheel};
use events::ElementState::{Pressed, Released};
use events::MouseButton::{Left, Right, Middle};
+ use events::MouseScrollDelta::{LineDelta};
let event: &ffi::XButtonEvent = unsafe { mem::transmute(&xev) };
@@ -229,11 +230,13 @@ impl<'a> Iterator for PollEventsIterator<'a> {
ffi::Button2 => Some(Middle),
ffi::Button3 => Some(Right),
ffi::Button4 => {
- self.window.pending_events.lock().unwrap().push_back(MouseWheel(0.0, 1.0));
+ let delta = LineDelta(0.0, 1.0);
+ self.window.pending_events.lock().unwrap().push_back(MouseWheel(delta));
None
}
ffi::Button5 => {
- self.window.pending_events.lock().unwrap().push_back(MouseWheel(0.0, -1.0));
+ let delta = LineDelta(0.0, -1.0);
+ self.window.pending_events.lock().unwrap().push_back(MouseWheel(delta));
None
}
_ => None