From 41cb7019795578bcfa880a5a02f467ef78ecf52a Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Thu, 21 May 2020 14:45:47 +0900 Subject: [PATCH] fix: don't freeze when invoked while unity is recompiling (closes #342) Revert "fix: don't display invalid windows (may fix #292 #200)" This reverts commit 1bca012f --- src/logic/Windows.swift | 6 ------ src/ui/App.swift | 1 - 2 files changed, 7 deletions(-) diff --git a/src/logic/Windows.swift b/src/logic/Windows.swift index dc3cc2a38..a53d67c08 100644 --- a/src/logic/Windows.swift +++ b/src/logic/Windows.swift @@ -95,12 +95,6 @@ class Windows { } } - // some window can get invalid *after* we add them to our list, but without us getting notified about it - // workaround: we remove the invalid windows right before showing the UI - static func removeWindowsWhichBecameInvalid() { - Windows.list.removeAll(where: { !$0.axUiElement.isActualWindow($0.application.runningApplication.bundleIdentifier) }) - } - static func refreshIfWindowShouldBeShownToTheUser(_ window: Window, _ screen: NSScreen) { window.shouldShowTheUser = !(!Preferences.showMinimizedWindows && window.isMinimized) && !(!Preferences.showHiddenWindows && window.isHidden) && diff --git a/src/ui/App.swift b/src/ui/App.swift index bd44251b0..f3a1d0146 100644 --- a/src/ui/App.swift +++ b/src/ui/App.swift @@ -194,7 +194,6 @@ class App: NSApplication, NSApplicationDelegate { // TODO: find a way to update space index when windows are moved to another space, instead of on every trigger Windows.updateSpaces() let screen = Screen.preferred() - Windows.removeWindowsWhichBecameInvalid() Windows.refreshWhichWindowsToShowTheUser(screen) if (!Windows.list.contains { $0.shouldShowTheUser }) { hideUi(); return } Windows.updateFocusedWindowIndex(0)