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.
This commit is contained in:
parent
cb08d9b05b
commit
edc95d554d
2 changed files with 15 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue