Skip to content

Commit

Permalink
fix: refresh both thumbnails on focus switch in bg
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Mar 24, 2020
1 parent 357c616 commit 4fee590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/logic/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private func eventApplicationActivated(_ app: App, _ element: AXUIElement) {
let appFocusedWindow = element.focusedWindow(),
let existingIndex = Windows.list.firstIndexThatMatches(appFocusedWindow) else { return }
Windows.list.insert(Windows.list.remove(at: existingIndex), at: 0)
app.refreshOpenUi([Windows.list[0]])
app.refreshOpenUi([Windows.list[0], Windows.list[existingIndex]])
}

private func eventApplicationHiddenOrShown(_ app: App, _ element: AXUIElement, _ type: String) {
Expand All @@ -127,5 +127,5 @@ private func eventFocusedWindowChanged(_ app: App, _ element: AXUIElement) {
guard !app.appIsBeingUsed,
let existingIndex = Windows.list.firstIndexThatMatches(element) else { return }
Windows.list.insert(Windows.list.remove(at: existingIndex), at: 0)
app.refreshOpenUi([Windows.list[0]])
app.refreshOpenUi([Windows.list[0], Windows.list[existingIndex]])
}

0 comments on commit 4fee590

Please sign in to comment.