diff options
author | Robert Knight <robert.knight@mendeley.com> | 2015-06-28 21:55:54 +0100 |
---|---|---|
committer | Robert Knight <robert.knight@mendeley.com> | 2015-06-28 21:55:54 +0100 |
commit | cb08d9b05bb904e82a44bc67c818af9ba8a94568 (patch) | |
tree | 1ac1fc74ce896b6c4a1ab92a5601df77578614a8 /src/api/x11/window.rs | |
parent | 94c31e42a44b2621ae1ddc02b36ee5f0ee0bc16a (diff) | |
download | glutin-cb08d9b05bb904e82a44bc67c818af9ba8a94568.tar.gz glutin-cb08d9b05bb904e82a44bc67c818af9ba8a94568.zip |
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
Diffstat (limited to 'src/api/x11/window.rs')
-rw-r--r-- | src/api/x11/window.rs | 10 |
1 files changed, 6 insertions, 4 deletions
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 => { |