diff --git a/src/main.swift b/src/main.swift index 120491c0..a6e2c736 100644 --- a/src/main.swift +++ b/src/main.swift @@ -1,3 +1,12 @@ import AppKit +import Darwin + +// if the app is quit/force-quit from Activity Monitor, it will receive SIGTERM and applicationWillTerminate won't be called +// we intercept SIGTERM so we can reset the native command-tab shortcut +signal(SIGTERM) { _ in + // symbolic hotkeys state persist after the app is quit; we restore this shortcut before quitting + setNativeCommandTabEnabled(true) + exit(0) +} App.shared.run() diff --git a/src/ui/App.swift b/src/ui/App.swift index d0351198..78435876 100644 --- a/src/ui/App.swift +++ b/src/ui/App.swift @@ -4,7 +4,6 @@ import LetsMove import ShortcutRecorder import AppCenterCrashes - let cgsMainConnectionId = CGSMainConnectionID() var activity = ProcessInfo.processInfo.beginActivity(options: .userInitiatedAllowingIdleSystemSleep,