fix: handle being quit through activity-monitor (closes #1622)
This commit is contained in:
1 parent
e22f2f2e90
commit
69a5ffd8b2
2 files changed
+9
-1
No files matched your search
@@ -1,3 +1,12 @@
|
|||||||
import AppKit
|
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()
|
App.shared.run()
|
||||||
@@ -4,7 +4,6 @@ import LetsMove
|
|||||||
import ShortcutRecorder
|
import ShortcutRecorder
|
||||||
import AppCenterCrashes
|
import AppCenterCrashes
|
||||||
|
|
||||||
|
|
||||||
let cgsMainConnectionId = CGSMainConnectionID()
|
let cgsMainConnectionId = CGSMainConnectionID()
|
||||||
|
|
||||||
var activity = ProcessInfo.processInfo.beginActivity(options: .userInitiatedAllowingIdleSystemSleep,
|
var activity = ProcessInfo.processInfo.beginActivity(options: .userInitiatedAllowingIdleSystemSleep,
|
||||||
|
|||||||
Reference in new issue
Block a user