diff options
author | tcmal <me@aria.rip> | 2024-06-15 22:11:59 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-06-15 22:11:59 +0100 |
commit | c3e98e34ed7d42ef4271339de88f7131e7647442 (patch) | |
tree | 2065275616a3ad4d727369c87890dee10553e44b /src/main.rs | |
parent | 9db364a195cb5c0e8fb82e52e607d373ddb0e13c (diff) |
implement wm hints
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 19 |
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(()), + } } } |