Skip to content

Commit 51b6909

Browse files
bug fix: stop (sometimes) selecting wrong preview. remove redundant/bug fix: stop reopening in AltTab (red traffic light spam) (causes crash)
1 parent 15508bd commit 51b6909

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

src/ScriptCommands/showAppScriptCommand.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ class showAppScriptCommand: NSScriptCommand {
7171
App.app.isFirstSummon = false
7272
App.app.shortcutIndex = 2 // Shortcut 3 = index 2 = DockAltTab
7373
NSScreen.updatePreferred()
74-
if !Windows.updatesBeforeShowing() {
75-
print("ydaaaaa")
76-
App.app.hideUi(); return self } //commented out since active app = 0 windows = no previews for any tarApp, and modifying updatesBeforeShowing leads to keeping thumbnailsPanel open with 0 thumbnails (empty grey window)
74+
if !Windows.updatesBeforeShowing() {App.app.hideUi(); return self }
7775

7876
// Windows.detectTabbedWindows()
7977
// Spaces.refreshAllIdsAndIndexes()

src/logic/Window.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ class Window {
124124
closeButton_.performAction(kAXPressAction)
125125
}
126126
}
127-
//DockAltTab block below (auto reopen traffic controls)
128-
DispatchQueue.main.asyncAfter(deadline: .now() + 160/1000) {
129-
if let hoveredWindowIndex = Windows.hoveredWindowIndex,
130-
let recycledView = ThumbnailsView.recycledViews[safe: hoveredWindowIndex] {
131-
recycledView.mouseMoved()
132-
}
133-
}
134127
}
135128

136129
func canBeMinDeminOrFullscreened() -> Bool {
@@ -155,13 +148,6 @@ class Window {
155148
self.axUiElement!.setAttribute(kAXMinimizedAttribute, !self.isMinimized)
156149
}
157150
}
158-
//DockAltTab block below (auto reopen traffic controls)
159-
DispatchQueue.main.asyncAfter(deadline: .now() + 666/1000) {
160-
if let hoveredWindowIndex = Windows.hoveredWindowIndex,
161-
let recycledView = ThumbnailsView.recycledViews[safe: hoveredWindowIndex] {
162-
recycledView.mouseMoved()
163-
}
164-
}
165151
}
166152

167153
func toggleFullscreen() {

src/logic/Windows.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class Windows {
103103
let lastFocusedWindowIndex = getLastFocusedWindowIndex() {
104104
updateFocusedAndHoveredWindowIndex(lastFocusedWindowIndex)
105105
} else {
106-
if (DockAltTabMode && DockAltTabDockPos == "right") {
107-
cycleFocusedWindowIndex(list.count - 1)
108-
updateFocusedAndHoveredWindowIndex(list.count - 1)
106+
if (DockAltTabMode) {
107+
cycleFocusedWindowIndex(DockAltTabDockPos == "right" ? list.count - 1 : 0)
108+
updateFocusedAndHoveredWindowIndex(DockAltTabDockPos == "right" ? list.count - 1 : 0)
109109
} else {
110110
cycleFocusedWindowIndex(1)
111111
if focusedWindowIndex == 0 {

0 commit comments

Comments
 (0)