From 664db3626746020dac54e8aca807391d84eb1c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= <49094811+leonboe1@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:52:08 +0200 Subject: [PATCH] Fix alert enables app icon in dock --- QuickDrop/Util/ErrorAlertHandler.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/QuickDrop/Util/ErrorAlertHandler.swift b/QuickDrop/Util/ErrorAlertHandler.swift index 8ffd3a9..41dd65f 100644 --- a/QuickDrop/Util/ErrorAlertHandler.swift +++ b/QuickDrop/Util/ErrorAlertHandler.swift @@ -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()