From bd0ae7476c6decc5cc9631ced95bb82a86b0411e Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sun, 27 Jul 2014 15:21:42 +0200 Subject: Work on X11 events --- src/x11/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/x11/mod.rs') 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 { - // TODO: + use std::mem; + + let mut xev = unsafe { mem::uninitialized() }; + unsafe { ffi::XNextEvent(self.display, &mut xev) }; + + Vec::new() } -- cgit v1.2.3