diff options
author | Robert Knight <robert.knight@mendeley.com> | 2015-06-22 22:49:48 +0100 |
---|---|---|
committer | Robert Knight <robert.knight@mendeley.com> | 2015-06-28 13:25:09 +0100 |
commit | 94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a (patch) | |
tree | 79be93cc5541225a47fc2aa737daff2055634732 /src/api/x11/xdisplay.rs | |
parent | 164d47b93c7dc95cf52c5ef205a107a8a439e4ef (diff) | |
download | glutin-94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a.tar.gz glutin-94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a.zip |
Use XInput2 for event handling
This provides smooth scrolling for touchpad devices and will
enable support for touch events etc. in future.
Diffstat (limited to 'src/api/x11/xdisplay.rs')
-rw-r--r-- | src/api/x11/xdisplay.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/api/x11/xdisplay.rs b/src/api/x11/xdisplay.rs index 9037155..2576b74 100644 --- a/src/api/x11/xdisplay.rs +++ b/src/api/x11/xdisplay.rs @@ -12,6 +12,7 @@ pub struct XConnection { pub xlib: ffi::Xlib, pub xf86vmode: ffi::Xf86vmode, pub xcursor: ffi::Xcursor, + pub xinput2: ffi::XInput2, pub glx: Option<ffi::glx::Glx>, pub egl: Option<Egl>, pub display: *mut ffi::Display, @@ -30,6 +31,7 @@ impl XConnection { let xlib = try!(ffi::Xlib::open().map_err(|_| XNotSupported)); let xcursor = try!(ffi::Xcursor::open().map_err(|_| XNotSupported)); let xf86vmode = try!(ffi::Xf86vmode::open().map_err(|_| XNotSupported)); + let xinput2 = try!(ffi::XInput2::open().map_err(|_| XNotSupported)); unsafe extern "C" fn x_error_callback(_: *mut ffi::Display, event: *mut ffi::XErrorEvent) -> libc::c_int @@ -86,6 +88,7 @@ impl XConnection { xlib: xlib, xf86vmode: xf86vmode, xcursor: xcursor, + xinput2: xinput2, glx: glx, egl: egl, display: display, |