diff --git a/apps/macos/VODManager/Sources/VODManager/VODManagerApp.swift b/apps/macos/VODManager/Sources/VODManager/VODManagerApp.swift index 1363755..3bcc808 100644 --- a/apps/macos/VODManager/Sources/VODManager/VODManagerApp.swift +++ b/apps/macos/VODManager/Sources/VODManager/VODManagerApp.swift @@ -3,6 +3,8 @@ import SwiftData @main struct VODManagerApp: App { + @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate + var body: some Scene { WindowGroup { ContentView() @@ -15,3 +17,16 @@ struct VODManagerApp: App { } } } + +class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_ notification: Notification) { + NSApp.activate(ignoringOtherApps: true) + if let window = NSApp.windows.first { + window.makeKeyAndOrderFront(nil) + } + } + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +}