aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/x11/xdisplay.rs
diff options
context:
space:
mode:
authorRobert Knight <robert.knight@mendeley.com>2015-06-22 22:49:48 +0100
committerRobert Knight <robert.knight@mendeley.com>2015-06-28 13:25:09 +0100
commit94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a (patch)
tree79be93cc5541225a47fc2aa737daff2055634732 /src/api/x11/xdisplay.rs
parent164d47b93c7dc95cf52c5ef205a107a8a439e4ef (diff)
downloadglutin-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.rs3
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,