diff --git a/alt-tab-macos/logic/TrackedWindows.swift b/alt-tab-macos/logic/TrackedWindows.swift index 56f2b361..9b2e3580 100644 --- a/alt-tab-macos/logic/TrackedWindows.swift +++ b/alt-tab-macos/logic/TrackedWindows.swift @@ -22,7 +22,6 @@ class TrackedWindows { Spaces.currentSpaceIndex = spaces.first { $0.0 == Spaces.currentSpaceId }!.1 filterAndAddToList(mapWindowsWithRankAndSpace(spaces)) sortList() - TrackedWindows.focusedWindowIndex = TrackedWindows.moveFocusedWindowIndex(step) } private static func mapWindowsWithRankAndSpace(_ spaces: [(CGSSpaceID, SpaceIndex)]) -> [CGWindowID: (CGSSpaceID, SpaceIndex, WindowRank)] { diff --git a/alt-tab-macos/ui/Application.swift b/alt-tab-macos/ui/Application.swift index 9c96e3f7..8bb07ecf 100644 --- a/alt-tab-macos/ui/Application.swift +++ b/alt-tab-macos/ui/Application.swift @@ -77,8 +77,11 @@ class Application: NSApplication, NSApplicationDelegate, NSWindowDelegate { isFirstSummon = false TrackedWindows.refreshList(step) if TrackedWindows.list.count == 0 { + appIsBeingUsed = false + isFirstSummon = true return } + TrackedWindows.focusedWindowIndex = TrackedWindows.moveFocusedWindowIndex(step) let currentScreen = Screen.preferred() // fix screen between steps since it could change (e.g. mouse moved to another screen) if uiWorkShouldBeDone { self.thumbnailsPanel!.computeThumbnails(currentScreen); debugPrint("computeThumbnails") } if uiWorkShouldBeDone { self.thumbnailsPanel!.highlightCellAt(step); debugPrint("highlightCellAt") }