Skip to content

Commit

Permalink
fix: potentially fix shortcuts not working sometimes
Browse files Browse the repository at this point in the history
Also potentially fixed crashes as some shortcuts would execute code that should run on the main thread, from other threads
  • Loading branch information
lwouis committed May 25, 2020
1 parent fa1095e commit 8d833f5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/ui/preferences-window/tabs/GeneralTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ class GeneralTab: NSViewController, PreferencePane {
App.app.appIsBeingUsed = false
App.app.isFirstSummon = true
}
let fn = shortcutsActionsBlocks[controlId]!
let isShortcutAffectingTheUi = ["previousWindowShortcut", "nextWindowShortcut", "", "", "", "", "holdShortcut"].contains(controlId)
if isShortcutAffectingTheUi || isShortcutClosingTheUi {
DispatchQueue.main.async { () -> () in fn() }
} else {
fn()
}
DispatchQueue.main.async { () -> () in shortcutsActionsBlocks[controlId]!() }
}
return true
})
Expand Down

0 comments on commit 8d833f5

Please sign in to comment.