From edc95d554dd530a810240261d44013f39bef1c6d Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 28 Jun 2015 22:09:26 +0100 Subject: X11 - Ignore scroll events that happen outside of Glutin windows Scroll deltas are calculated in X11 by comparing the current and previous absolute values for the scroll axis when a scroll motion event is received. If the user scrolls whilst the cursor is outside of the window then an incorrect delta is reported when the cursor re-enters the window. Fix this by resetting the last-seen axis values whenever the cursor re-enters the window. --- src/api/x11/window.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/api/x11/window.rs') diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs index b430ec9..9a01e17 100644 --- a/src/api/x11/window.rs +++ b/src/api/x11/window.rs @@ -7,7 +7,6 @@ use std::{mem, ptr}; use std::cell::Cell; use std::sync::atomic::AtomicBool; use std::collections::VecDeque; -use std::slice::from_raw_parts; use std::sync::{Arc, Mutex}; use Api; @@ -23,7 +22,7 @@ use api::egl::Context as EglContext; use platform::MonitorID as PlatformMonitorID; use super::input::XInputEventHandler; -use super::{events, ffi}; +use super::{ffi}; use super::{MonitorID, XConnection}; // XOpenIM doesn't seem to be thread-safe -- cgit v1.2.3