From d12590387a1107e2ba3816b314668207f12127f9 Mon Sep 17 00:00:00 2001 From: Davide Date: Wed, 30 Oct 2024 14:47:29 +0100 Subject: [PATCH] Always close window on .isVisible = false E.g. "About" would open main window when launched from login item. --- .../Library/Sources/AppUIMain/Views/AppMenu/AppWindow.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Passepartout/Library/Sources/AppUIMain/Views/AppMenu/AppWindow.swift b/Passepartout/Library/Sources/AppUIMain/Views/AppMenu/AppWindow.swift index 011276a1..82bff763 100644 --- a/Passepartout/Library/Sources/AppUIMain/Views/AppMenu/AppWindow.swift +++ b/Passepartout/Library/Sources/AppUIMain/Views/AppMenu/AppWindow.swift @@ -40,16 +40,14 @@ public final class AppWindow { if newValue { NSApp.activate(ignoringOtherApps: true) window.makeKeyAndOrderFront(self) + } else { + window.close() } } } private init() { } - - public func close() { - window.close() - } } private extension AppWindow {