|
|
@ -160,9 +160,13 @@ open class AppDelegate: NSObject, NSApplicationDelegate { |
|
|
|
private func setActivationPolicy() { |
|
|
|
private func setActivationPolicy() { |
|
|
|
let defaults = UserDefaults.standard |
|
|
|
let defaults = UserDefaults.standard |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let currentActivationPolicy = NSRunningApplication.current.activationPolicy |
|
|
|
let activationPolicy: NSApplication.ActivationPolicy = defaults.integer(forKey: CLAppDislayOptions) == 0 ? .accessory : .regular |
|
|
|
let activationPolicy: NSApplication.ActivationPolicy = defaults.integer(forKey: CLAppDislayOptions) == 0 ? .accessory : .regular |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if currentActivationPolicy != activationPolicy { |
|
|
|
NSApp.setActivationPolicy(activationPolicy) |
|
|
|
NSApp.setActivationPolicy(activationPolicy) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private func checkIfAppIsAlreadyOpen() { |
|
|
|
private func checkIfAppIsAlreadyOpen() { |
|
|
|
guard let bundleID = Bundle.main.bundleIdentifier else { |
|
|
|
guard let bundleID = Bundle.main.bundleIdentifier else { |
|
|
|