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.
This commit is contained in:
Armin Friedl 2021-11-16 21:19:50 +01:00
parent e4e1ed4f73
commit 496bea1df2

View file

@ -19,13 +19,14 @@ impl Window {
fn is_normal_window(&self, con: &ewmh::Connection, window: u32) -> Result<bool, xcb::GenericError> {
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<String, xcb::GenericError> {
@ -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();