Fix activation policy being reapplied unnecessarily during app switching
This commit is contained in:
parent
e5e194de5f
commit
ba68ec429c
@ -10,8 +10,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
|
||||
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||
menuBarManager?.applyActivationPolicy()
|
||||
|
||||
if !flag, let menuBarManager = menuBarManager, !menuBarManager.isMenuBarOnly {
|
||||
if WindowManager.shared.showMainWindow() != nil {
|
||||
return false
|
||||
@ -19,11 +17,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ notification: Notification) {
|
||||
menuBarManager?.applyActivationPolicy()
|
||||
}
|
||||
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class MenuBarManager: ObservableObject {
|
||||
WindowManager.shared.showMainWindow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if Thread.isMainThread {
|
||||
applyPolicy()
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user