From 496bea1df217444951f70c47514e40095abf4219 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Tue, 16 Nov 2021 21:19:50 +0100 Subject: [PATCH] Treat window without type like normal window Some windows do not specify any `_NET_WM_WINDOW_TYPE`. In that case treat them like normal windows. It is expected that creaters of special windows are more concious about setting this property correctly. Normal developers may be unaware and are more likely not to specify the type. E.g. Official Spotify does not have a `_NET_WM_WINDOW_TYPE` in the latest version. --- src/sources/windows.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sources/windows.rs b/src/sources/windows.rs index 9ca22dc..610b1bc 100644 --- a/src/sources/windows.rs +++ b/src/sources/windows.rs @@ -19,13 +19,14 @@ impl Window { fn is_normal_window(&self, con: &ewmh::Connection, window: u32) -> Result { let wm_type_reply = ewmh::get_wm_window_type(con, window).get_reply()?; + for atom in wm_type_reply.atoms() { if *atom == con.WM_WINDOW_TYPE_NORMAL() { return Ok(true); } } - Err(xcb::GenericError{ptr: ptr::null_mut()}) + Ok(false) } fn window_category(&self, con: &ewmh::Connection, window: u32) -> Result { @@ -94,7 +95,7 @@ impl Source for Window { match self.is_normal_window(&ewmh_conn, *w) { Ok(true) => {}, Ok(false) => continue, - Err(_err) => continue + Err(_err) => {} } let title = self.window_title(&ewmh_conn, *w).unwrap();