fix(wm): add hack to manage activity monitor on start

I was running into this a lot when debugging the WindowServer memory
ballooning issue fixed in the last commit - the title returned by
CGWindowListCopyWindowInfo and the title returned by kAXWindowsAttribute
for Activity Monitor differs, so when restarting komorebi, if Activity
Monitor is open, it wouldn't get managed.

Added a little hack as a workaround for now.
This commit is contained in:
LGUG2Z committed 2025-10-26 19:51:29 -07:00
1 parent 2e4660dc12
commit 4d25d4efb0
1 file changed
+4 -1
+4 -1
View File
@@ -188,7 +188,10 @@ impl Application {
let window = Window::new(element, self.clone()).ok()?; let window = Window::new(element, self.clone()).ok()?;
if let Some(window_title) = window.title() if let Some(window_title) = window.title()
&& window_title.eq(title) && (window_title.eq(title)
// TODO: find a better way to deal with these hacks
|| (self.name().unwrap_or_default() == "Activity Monitor"
&& window_title.starts_with(title)))
{ {
target = Some(window); target = Some(window);
} }