From c3e98e34ed7d42ef4271339de88f7131e7647442 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sat, 15 Jun 2024 22:11:59 +0100 Subject: implement wm hints --- src/main.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/main.rs') 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(()), + } } } -- cgit v1.2.3