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/event.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/event.rs')
-rw-r--r-- | src/event.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.rs b/src/event.rs index 6c4c375..5a5b1b9 100644 --- a/src/event.rs +++ b/src/event.rs @@ -12,12 +12,12 @@ use x11::xlib::{ XMapEvent, XConfigureEvent, }; - use x11::xlib; use x11::xlib::Display; +use libc::c_int; use std::fmt; -use safe_x11::next_xevent; +use safe_x11::event::next_xevent; pub enum Event { Key(XKeyEvent, bool), @@ -55,8 +55,8 @@ impl fmt::Debug for Event { } } -pub fn next_event(display: *mut Display) -> Event { - let ev = next_xevent(display); +pub fn next_event(display: *mut Display, fd: c_int) -> Event { + let ev = next_xevent(display, fd); match ev.get_type() { 2 => Event::Key(xlib::XKeyEvent::from(ev), true), |