summaryrefslogtreecommitdiff
path: root/src/focus.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/focus.rs')
-rw-r--r--src/focus.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/focus.rs b/src/focus.rs
index bee148d..b26381e 100644
--- a/src/focus.rs
+++ b/src/focus.rs
@@ -1,6 +1,6 @@
use xcb::x::{
- self, EnterNotifyEvent, FocusInEvent, InputFocus, NotifyDetail, NotifyMode, SetInputFocus,
- Window,
+ self, DeleteProperty, EnterNotifyEvent, FocusInEvent, InputFocus, NotifyDetail, NotifyMode,
+ SetInputFocus, Window,
};
use crate::{error::*, WM};
@@ -46,11 +46,15 @@ impl WM<'_> {
focus: window,
time: x::CURRENT_TIME,
});
- // TODO: XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
+ self.conn.send_request(&DeleteProperty {
+ window,
+ property: self.atoms.net_active_window,
+ });
}
}
/// Refocus on the client with the given co-ordinates, setting X11 properties as required.
+ /// If the given index is invalid, focus on the root instead.
/// This function sends multiple requests without checking them, so `conn.flush()` should be called after.
pub fn refocus(&mut self, mon: usize, i: usize) {
self.unfocus();
@@ -61,6 +65,8 @@ impl WM<'_> {
// TODO: set input focus
// TODO: set active window
// TODO: send wmtakefocus event
+ } else {
+ // TODO: focus on root
}
}