aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11/mod.rs')
-rw-r--r--src/x11/mod.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/x11/mod.rs b/src/x11/mod.rs
index 8849441..e6297f1 100644
--- a/src/x11/mod.rs
+++ b/src/x11/mod.rs
@@ -57,7 +57,7 @@ impl Window {
let mut set_win_attr = {
let mut swa: ffi::XSetWindowAttributes = unsafe { mem::zeroed() };
swa.colormap = cmap;
- //swa.event_mask = ExposureMask | KeyPressMask;
+ swa.event_mask = ffi::ExposureMask | ffi::ResizeRedirectMask | ffi::KeyPressMask;
swa
};
@@ -65,7 +65,7 @@ impl Window {
let window = unsafe {
let win = ffi::XCreateWindow(display, root, 10, 10, 800, 600,
0, (*visual_infos).depth, ffi::InputOutput, (*visual_infos).visual,
- ffi::CWColormap/* | ffi::CWEventMask*/, &mut set_win_attr);
+ ffi::CWColormap | ffi::CWEventMask, &mut set_win_attr);
win
};
@@ -120,7 +120,12 @@ impl Window {
}
pub fn wait_events(&self) -> Vec<Event> {
- // TODO:
+ use std::mem;
+
+ let mut xev = unsafe { mem::uninitialized() };
+ unsafe { ffi::XNextEvent(self.display, &mut xev) };
+
+
Vec::new()
}