summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index e652dca..8bf3caa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,6 +14,7 @@ use dotwm::DotWM;
use command::*;
use event::{Event,next_event};
use socket::{configure_wm, listen_socket};
+use safe_x11::event as x11_event;
use std::collections::HashMap;
@@ -29,6 +30,7 @@ fn main() {
println!("Creating dotwm");
let mut dotwm = DotWM::new();
let mut bindings: BindingHash = HashMap::new();
+ let x11_fd = x11_event::x11_fd(dotwm.display);
add_binding(&mut dotwm,&mut bindings, keysym::XK_Return, xlib::Mod4Mask, exec,
&["xterm"]);
@@ -65,14 +67,15 @@ fn main() {
}
}
});
-
configure_wm(&mut dotwm, &receiver);
// Main loop
loop {
+ println!("Listening socket");
listen_socket(&mut dotwm, &receiver);
// Event handling.
- let event = next_event(dotwm.display);
+ println!("Waiting event");
+ let event = next_event(dotwm.display, x11_fd);
println!("Event {:?}", event);
match event {
Event::Key(mut e, true) => {
@@ -100,7 +103,7 @@ fn main() {
dotwm.change_focus_of(idx);
}
},
- _ => (),
+ _ => println!("Unknown event"),
}
collect_zombies();
}