From 486aecda4c60cf7a27ce8544458ee5ad434b32de Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 26 Sep 2025 12:21:21 -0700 Subject: [PATCH] fix(wm): respect rules on startup window scan --- komorebi/src/macos_api.rs | 10 +++++++--- komorebi/src/window.rs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/komorebi/src/macos_api.rs b/komorebi/src/macos_api.rs index 9abf1247..8f981eca 100644 --- a/komorebi/src/macos_api.rs +++ b/komorebi/src/macos_api.rs @@ -15,6 +15,7 @@ use crate::core_graphics::CoreGraphicsApi; use crate::ioreg::IoReg; use crate::monitor::Monitor; use crate::monitor::MonitorInfo; +use crate::window::RuleDebug; use crate::window::WindowInfo; use crate::window_manager::WindowManager; use color_eyre::eyre; @@ -285,9 +286,12 @@ impl MacosApi { }; if let Some(window) = application.window_by_title(&info.name) { - window.observe(&wm.run_loop)?; - entry.push(window); - valid_window_count += 1 + let mut rule_debug = RuleDebug::default(); + if window.should_manage(None, &mut rule_debug)? { + window.observe(&wm.run_loop)?; + entry.push(window); + valid_window_count += 1 + } } } } diff --git a/komorebi/src/window.rs b/komorebi/src/window.rs index bbc48110..06d6a771 100644 --- a/komorebi/src/window.rs +++ b/komorebi/src/window.rs @@ -643,7 +643,7 @@ impl Window { #[tracing::instrument(skip_all)] pub fn should_manage( - self, + &self, event: Option, debug: &mut RuleDebug, ) -> eyre::Result {