From cb08d9b05bb904e82a44bc67c818af9ba8a94568 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 28 Jun 2015 21:55:54 +0100 Subject: Remove XInput2 code for handling keyboard events * For the moment we're still using plain core X11 events for handling keyboard activity, so remove the XInput2 code for that * Small refactoring of X11 input handling and documentation fixes --- src/api/x11/window.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/api/x11/window.rs') diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs index 300fdb5..b430ec9 100644 --- a/src/api/x11/window.rs +++ b/src/api/x11/window.rs @@ -177,15 +177,17 @@ impl<'a> Iterator for PollEventsIterator<'a> { return Some(ev); } + let xlib = &self.window.x.display.xlib; + loop { let mut xev = unsafe { mem::uninitialized() }; - let res = unsafe { (self.window.x.display.xlib.XCheckMaskEvent)(self.window.x.display.display, -1, &mut xev) }; + let res = unsafe { (xlib.XCheckMaskEvent)(self.window.x.display.display, -1, &mut xev) }; if res == 0 { - let res = unsafe { (self.window.x.display.xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::ClientMessage, &mut xev) }; + let res = unsafe { (xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::ClientMessage, &mut xev) }; if res == 0 { - let res = unsafe { (self.window.x.display.xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::GenericEvent, &mut xev) }; + let res = unsafe { (xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::GenericEvent, &mut xev) }; if res == 0 { return None; } @@ -194,7 +196,7 @@ impl<'a> Iterator for PollEventsIterator<'a> { match xev.get_type() { ffi::KeymapNotify => { - unsafe { (self.window.x.display.xlib.XRefreshKeyboardMapping)(mem::transmute(&xev)); } + unsafe { (xlib.XRefreshKeyboardMapping)(mem::transmute(&xev)); } }, ffi::ClientMessage => { -- cgit v1.2.3