Post

Replies

Boosts

Views

Activity

After crashing duplicate identical windows are opened
Hello! On visionOS, after an app with multiple scenes defined crashes and is re-launched, two windows are opened with identical contents. Please see below for a minimal example: struct SecondaryWindowTag: Codable, Hashable {} enum WindowTag { static let secondaryWindow = SecondaryWindowTag() } @main struct SwiftUIExampleApp: App { @Environment(\.openWindow) private var openWindow var body: some Scene { WindowGroup { Button { openWindow(value: WindowTag.secondaryWindow) } label: { Text("Open Window") } .buttonStyle(.bordered) } WindowGroup(for: SecondaryWindowTag.self) { _ in Button { fatalError("Test crash") } label: { Text("Crash") } } } } Here is a screenshot taken after re-launching following a crash. You can see there are two windows both having the "Open Window" button of the first WindowScene defined above. Is this a known issue? Are there any workarounds I could try? Thank you!
2
0
232
Aug ’24