From 8d833f516356f55c41011f0d79ca619e036798b2 Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Mon, 25 May 2020 01:44:34 +0900 Subject: [PATCH] fix: potentially fix shortcuts not working sometimes Also potentially fixed crashes as some shortcuts would execute code that should run on the main thread, from other threads --- src/ui/preferences-window/tabs/GeneralTab.swift | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ui/preferences-window/tabs/GeneralTab.swift b/src/ui/preferences-window/tabs/GeneralTab.swift index 879b344f..48701c8f 100644 --- a/src/ui/preferences-window/tabs/GeneralTab.swift +++ b/src/ui/preferences-window/tabs/GeneralTab.swift @@ -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 })