Fix alert enables app icon in dock

This commit is contained in:
Leon Böttger committed 2026-06-19 13:52:08 +02:00
1 parent 167542f0fa
commit 664db36267
1 file changed
+5 -2
+5 -2
View File
@@ -18,7 +18,7 @@ import Cocoa
#endif
class ErrorAlertHandler {
private init() {}
static let shared = ErrorAlertHandler()
@@ -186,7 +186,10 @@ class ErrorAlertHandler {
}
private func bringAlertWindowToFront(_ window: NSWindow) {
_ = NSApp.setActivationPolicy(.regular)
// Keep the app a menu-bar (.accessory) app: do NOT switch to .regular,
// which would add a dock icon that lingers after the alert closes.
// orderFrontRegardless() brings the window to the front even though the
// app stays inactive in the background.
NSApp.activate(ignoringOtherApps: true)
window.makeKeyAndOrderFront(nil)
window.orderFrontRegardless()