summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 25b4bb9..374b403 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -221,9 +221,22 @@ impl WM<'_> {
}
/// Handle a property notify event, by doing *todo*
- fn handle_property_notify(&self, _e: PropertyNotifyEvent) -> Result<()> {
- println!("TODO: handle_property_notify");
- Ok(())
+ fn handle_property_notify(&mut self, e: PropertyNotifyEvent) -> Result<()> {
+ match e.atom() {
+ x::ATOM_WM_HINTS => {
+ let Some(p) = self.clients.find_client_pos(e.window()) else {
+ return Ok(());
+ };
+ let focused = p == self.clients.focused();
+ self.clients.client_mut(p.0, p.1).and_then(|c| {
+ c.sync_properties(self.conn, focused);
+ Some(())
+ });
+
+ Ok(())
+ }
+ _ => Ok(()),
+ }
}
}