From 9b9c96a89d20af6f7fcf0cb528013ab391c9c014 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 27 Sep 2025 17:01:59 -0700 Subject: [PATCH] fix(wm): don't duplicate windows on empty workspaces This commit fixes a subtle boolean logic bug that I think was introduced by a "cargo clippy --fix" to apply some new boolean chaining stuff in Rust 2024. Gotta be more careful. --- komorebi/src/process_event.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 7322c25d..1b659e2b 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -405,12 +405,8 @@ impl WindowManager { } if let Some((m_idx, w_idx)) = self.known_window_ids.get(&window_id) - && let Some(focused_workspace_idx) = self - .monitors() - .get(*m_idx) - .map(|m| m.focused_workspace_idx()) - && *m_idx != self.focused_monitor_idx() - && *w_idx != focused_workspace_idx + && let Ok(focused_workspace_idx) = self.focused_workspace_idx() + && (*m_idx != self.focused_monitor_idx() || *w_idx != focused_workspace_idx) { tracing::debug!( "ignoring show event for window already associated with another workspace"