summaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2015-11-09 01:33:33 -0300
committerMatias Linares <matiaslina@openmailbox.org>2015-11-09 01:33:33 -0300
commit05bfd598a060beafe1a20ff759e499987f1ce87b (patch)
treedba0e6ddc3c8d110ece5bbdd4b3f7f12063eb0a5 /src/event.rs
parenta92f31598c7f5c5be971d643435193c52080b4dc (diff)
downloaddotwm-05bfd598a060beafe1a20ff759e499987f1ce87b.tar.gz
Focus handling.
For now this have some bugs. Some complex programs (i.e. thunar, firefox) will spawn a lot of XCreateEvents and the last window it's not focused correctly. Also the enter notify should work on an input instead hovering the window
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs
index e15ee18..366ca28 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -6,6 +6,8 @@ use x11::xlib::{
XCrossingEvent,
XCreateWindowEvent,
XDestroyWindowEvent,
+ XUnmapEvent,
+ XMapEvent,
XConfigureEvent,
};
@@ -24,6 +26,8 @@ pub enum Event {
Generic(XEvent),
Create(XCreateWindowEvent),
Destroy(XDestroyWindowEvent),
+ Unmap(XUnmapEvent),
+ Map(XMapEvent),
Configure(XConfigureEvent),
NoEvent
}
@@ -39,6 +43,8 @@ impl fmt::Debug for Event {
&Event::Leave(ev) => format!("Enter({})", XEvent::from(ev).get_type()),
&Event::Create(ev) => format!("Create({})", XEvent::from(ev).get_type()),
&Event::Destroy(ev) => format!("Destroy({})", XEvent::from(ev).get_type()),
+ &Event::Unmap(ev) => format!("Unmap({})", XEvent::from(ev).get_type()),
+ &Event::Map(ev) => format!("Map({})", XEvent::from(ev).get_type()),
&Event::Configure(ev) => format!("Configure({})", XEvent::from(ev).get_type()),
&Event::NoEvent => format!("NoEvent"),
};
@@ -60,6 +66,8 @@ pub fn next_event(display: *mut Display) -> Event {
8 => Event::Leave(XCrossingEvent::from(ev)),
16 => Event::Create(XCreateWindowEvent::from(ev)),
17 => Event::Destroy(XDestroyWindowEvent::from(ev)),
+ 18 => Event::Unmap(XUnmapEvent::from(ev)),
+ 19 => Event::Map(XMapEvent::from(ev)),
22 => Event::Configure(XConfigureEvent::from(ev)),
e => {
println!("Unknown event {}", e);