aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/x11/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/x11/window.rs')
-rw-r--r--src/api/x11/window.rs10
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 => {