Files
punktfunk/clients/apple/Sources/PunktfunkClient/PunktfunkClientApp.swift
T
enricobuehler bce820ec67
ci / rust (push) Has been cancelled
fix(apple): title the app "Punktfunkempfänger" — navigation title + window title
Matches the bundle display name; was the lowercase project name "punktfunk" in the
home navigation title (iOS large title / macOS titlebar) and the WindowGroup title.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 12:49:17 +02:00

41 lines
1.1 KiB
Swift

// PunktfunkClient the macOS client app (also runs unbundled via swift run).
// Hosts grid trust-on-first-use StreamView (AVSampleBufferDisplayLayer HEVC) + input.
#if os(macOS)
import AppKit
#endif
import SwiftUI
@main
struct PunktfunkClientApp: App {
#if os(macOS)
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
#endif
var body: some Scene {
WindowGroup("Punktfunkempfänger") {
ContentView()
}
#if os(macOS)
Settings {
SettingsView()
}
#endif
}
}
#if os(macOS)
final class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
// `swift run` launches an unbundled binary; promote it to a regular app so the
// window fronts and receives keyboard/mouse focus (GameController needs focus).
NSApp.setActivationPolicy(.regular)
NSApp.activate(ignoringOtherApps: true)
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
true
}
}
#endif