From 5da38341bc54f24c8cad41f1b63405d8cc955fe7 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 22 Nov 2015 02:58:41 -0300 Subject: 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. --- src/safe_x11/mod.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/safe_x11/mod.rs') 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 -- cgit v1.2.3-70-g09d2