From eba5e422bf4646900124a127e3306c796efba65b Mon Sep 17 00:00:00 2001 From: lwouis Date: Sat, 31 Aug 2024 18:01:32 +0200 Subject: [PATCH] fix: finder would sometimes not be listed (closes #3350) --- src/logic/Application.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/logic/Application.swift b/src/logic/Application.swift index aa47d44a..14c691b0 100644 --- a/src/logic/Application.swift +++ b/src/logic/Application.swift @@ -63,6 +63,7 @@ class Application: NSObject { // TODO: this method manually checks windows, but will not find windows on other Spaces retryAxCallUntilTimeout(group, 5) { [weak self] in guard let self = self else { return } + var atLeastOneActualWindow = false if let axWindows_ = try self.axUiElement!.windows(), axWindows_.count > 0 { // bug in macOS: sometimes the OS returns multiple duplicate windows (e.g. Mail.app starting at login) try Array(Set(axWindows_)).forEach { axWindow in @@ -76,6 +77,7 @@ class Application: NSObject { let isFullscreen = try axWindow.isFullscreen() let isMinimized = try axWindow.isMinimized() let position = try axWindow.position() + atLeastOneActualWindow = true DispatchQueue.main.async { [weak self] in guard let self = self else { return } if let window = (Windows.list.first { $0.isEqualRobust(axWindow, wid) }) { @@ -92,7 +94,8 @@ class Application: NSObject { } } } - } else { + } + if (!atLeastOneActualWindow) { DispatchQueue.main.async { [weak self] in guard let self = self else { return } let window = self.addWindowslessAppsIfNeeded()