diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index dcef752..f745e92 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,7 @@ use event::{Event,select_event}; use socket::parser; use std::collections::HashMap; +use std::mem::uninitialized; use x11::xlib; use x11::keysym; @@ -77,12 +78,20 @@ fn main() { dotwm.remove_window(e.window); }, Event::Enter(e) => { - if let Some(idx) = dotwm.find_window(e.window) { + if let Some(idx) = dotwm.window_idx(e.window) { dotwm.change_focus_of(idx); } }, Event::Expose(_) => { }, + Event::Drag(e) => { + // We can "compress" the drag notify here. + unsafe{ + let mut new_ev = uninitialized(); + while xlib::XCheckTypedEvent(dotwm.display, xlib::MotionNotify, &mut new_ev) != 0 {}; + }; + exec_func(&mut dotwm, &mut bindings, 1, e.state, xlib::XEvent::from(e)); + }, Event::Socket(stream) => { let mut s = stream.try_clone().unwrap(); let mut buf = String::new(); |