Skip to content

Commit 3d5cd9e

Browse files
committed
fix: prevent duplicate window on reopen from dock
Use Window scene instead of WindowGroup to prevent SwiftUI from creating a second window when the app is reopened via dock icon while the original window is hidden (not closed). WindowGroup is designed for multi-window apps and creates a new window instance when no visible window exists. Window is a single- instance scene type that correctly handles the hidden window case.
1 parent ce7a89f commit 3d5cd9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

App/KasetApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct KasetApp: App {
112112
}
113113

114114
var body: some Scene {
115-
WindowGroup {
115+
Window("Kaset", id: "main") {
116116
// Skip UI during unit tests to prevent window spam
117117
if UITestConfig.isRunningUnitTests, !UITestConfig.isUITestMode {
118118
Color.clear

0 commit comments

Comments
 (0)