From 94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 22 Jun 2015 22:49:48 +0100 Subject: Use XInput2 for event handling This provides smooth scrolling for touchpad devices and will enable support for touch events etc. in future. --- src/api/x11/xdisplay.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/api/x11/xdisplay.rs') 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, pub egl: Option, 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, -- cgit v1.2.3