tony / oxwm

refactor window property checks in `scan_existing_windows` Browse files
emzywastaken committed 2025-10-13 parent 53a4fb6 commit ab1e2fc13874a3e212d3b34bca3f43c984d9eb2a
Showing 1 changed file with 4 additions and 10 deletions. UnifiedSplit
+4 −10 src/window_manager.rs
@@ -187,27 +187,21 @@ impl WindowManager {
187 187 }
188 188
189 189 if attrs.map_state == MapState::UNMAPPED {
190 - let has_wm_state = match self
190 + let has_wm_state = self
191 191 .connection
192 192 .get_property(false, window, wm_state_atom, AtomEnum::ANY, 0, 2)?
193 193 .reply()
194 - {
195 - Ok(prop) => !prop.value.is_empty(),
196 - Err(_) => false,
197 - };
194 + .is_ok_and(|prop| !prop.value.is_empty());
198 195
199 196 if !has_wm_state {
200 197 continue;
201 198 }
202 199
203 - let has_wm_class = match self
200 + let has_wm_class = self
204 201 .connection
205 202 .get_property(false, window, AtomEnum::WM_CLASS, AtomEnum::STRING, 0, 1024)?
206 203 .reply()
207 - {
208 - Ok(prop) => !prop.value.is_empty(),
209 - Err(_) => false,
210 - };
204 + .is_ok_and(|prop| !prop.value.is_empty());
211 205
212 206 if has_wm_class {
213 207 let tag = self.get_saved_tag(window, net_client_info)?;