Browse Source

Change only if activation policy is different.

pull/92/head
Abhishek 5 years ago
parent
commit
2cc37f3eee
  1. 6
      Clocker/AppDelegate.swift

6
Clocker/AppDelegate.swift

@ -160,8 +160,12 @@ 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
NSApp.setActivationPolicy(activationPolicy)
if currentActivationPolicy != activationPolicy {
NSApp.setActivationPolicy(activationPolicy)
}
} }
private func checkIfAppIsAlreadyOpen() { private func checkIfAppIsAlreadyOpen() {

Loading…
Cancel
Save