diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2015-11-22 02:58:41 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2015-11-22 02:58:41 -0300 |
commit | 5da38341bc54f24c8cad41f1b63405d8cc955fe7 (patch) | |
tree | debe4dda2dd02cc23ed64b54df768a0f584938d2 /src/safe_x11/mod.rs | |
parent | a21473f60c6cfad6335db3b0b45cdff23f8b3a89 (diff) | |
download | dotwm-5da38341bc54f24c8cad41f1b63405d8cc955fe7.tar.gz |
next_xevent don't block anymore!
Now the next_xevent (from the safex11) will not block forever. So we
can listen the socket without doing some thread stuff.
Diffstat (limited to 'src/safe_x11/mod.rs')
-rw-r--r-- | src/safe_x11/mod.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/safe_x11/mod.rs b/src/safe_x11/mod.rs index e587021..06c7b3c 100644 --- a/src/safe_x11/mod.rs +++ b/src/safe_x11/mod.rs @@ -13,9 +13,6 @@ use x11::xlib::{ // Windows Window, - - // Events - XEvent, }; use x11::xlib::XKeyEvent; @@ -28,6 +25,7 @@ use std::slice; use std::fmt; pub mod window; +pub mod event; #[derive(Debug)] pub struct XSafeError<'a> { @@ -137,16 +135,6 @@ pub fn grab_key(display: *mut Display, key: u32, modifiers: u32, owner_events: b } } -/// Get the next event from the xserver. This call will block until a -/// event spawns. -pub fn next_xevent(display: *mut Display) -> XEvent { - unsafe { - let mut last_event: XEvent = uninitialized(); - xlib::XNextEvent(display, &mut last_event); - last_event - } -} - // Window code. /// Get a list from the active windows. This doesn't generate a hierarchical |