And even if the first window to open includes openWindow commands, they seem to not execute, as is the case when the LaunchView is the first to open when relaunching this example app. My Application Scene Manifest's (UIApplicationSceneManifest) Preferred Default Scene Session Role (UIApplicationPreferredDefaultSceneSessionRole) is Window Application Session (UIWindowSceneSessionRoleApplication).
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
LaunchView()
}
WindowGroup(id: "GameControlWindow") {
GameControlWindow()
.padding()
}
WindowGroup(id: "GameVolume") {
GameView()
}
.windowStyle(.volumetric)
}
}
struct LaunchView: View {
@Environment(\.openWindow) var openWindow
var body: some View {
EmptyView()
.onAppear() {
openWindow(id: "GameControlWindow")
openWindow(id: "GameVolume")
}
}
}