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()