Skip to content

Commit

Permalink
fix: shortcuts stop working if active app is quit (closes #557)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Aug 27, 2020
1 parent a552c4c commit 023561d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/logic/events/AccessibilityEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ private func applicationActivated(_ element: AXUIElement) throws {
if let appFocusedWindow = try element.focusedWindow(),
let wid = try appFocusedWindow.cgWindowId() {
DispatchQueue.main.async {
// ensure alt-tab window remains key, so local shortcuts work
if App.app.appIsBeingUsed { App.app.thumbnailsPanel.makeKeyAndOrderFront(nil) }
guard let existingIndex = Windows.list.firstIndexThatMatches(appFocusedWindow, wid) else { return }
Windows.list.insertAndScaleRecycledPool(Windows.list.remove(at: existingIndex), at: 0)
App.app.refreshOpenUi([Windows.list[0], Windows.list[existingIndex]])
Expand Down

0 comments on commit 023561d

Please sign in to comment.