Avoid moving active space when trying to quit macOS app

This commit is contained in:
Ivan Grachev 2022-08-02 14:28:10 +03:00
parent 9553ed98f5
commit 9a377eea61

View File

@ -160,11 +160,14 @@ class Agent: NSObject {
alert.alertStyle = .warning
alert.addButton(withTitle: Strings.ok)
alert.addButton(withTitle: Strings.cancel)
if alert.runModal() == .alertFirstButtonReturn {
NSApp.terminate(nil)
}
if updateStatusBarAfterwards {
setupStatusBarItem()
DispatchQueue.main.async { [weak self] in
if alert.runModal() == .alertFirstButtonReturn {
NSApp.terminate(nil)
}
if updateStatusBarAfterwards {
self?.setupStatusBarItem()
}
}
}