mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Fix alert enables app icon in dock
This commit is contained in:
1 parent
167542f0fa
commit
664db36267
1 file changed
+5
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user