Vision Pro: UX: how to close an immersive view?

From my 2D WindowGroup, the user can open an ImmersiveSpace. (For some reason the original 2D WindowGroup disappears as soon as the mouse cursor is not over that windows anymore, so the user is only in the immersive space, not sure what the logic is there)

Bt anyhow, what is the standard UX pattern to let the user exit that space again, and return to the 2D part of the app?

This is roughly my app's setup:

 var body: some SwiftUI.Scene {
        WindowGroup {
            ContentView().environmentObject(buildingModel)
        }
        
        ImmersiveSpace(id: "ImmersiveSpaceVideoWrapper"){
            Immersive360VideoPlayer()
        }.immersionStyle(selection: $currentStyle, in: .mixed, .progressive, .full)
        
        ImmersiveSpace(id: "ImmersiveSpacePhotoWrapper"){
            Immersive360Photo()
        }.immersionStyle(selection: $currentStyle, in: .mixed, .progressive, .full)
        
        
    }

Replies

Ok in this WWDC video they explain the process, however in my case, the 2D window disappears. So this approach won't work. Any insight, Apple? I would like to have a help session if possible... https://developer.apple.com/wwdc23/10111?time=822

I don't have a solution on offer, but I believe this is the project that's being presented in the linked session. If it has the sought after behavior, it should be straightforward to reverse engineer it.

Unless I'm misunderstanding your desired result, I believe you would want to include a view as an attachment to your RealityView inside of your ImmersiveSpace that would have a button or some toggle to be able to then dismiss the immersive view and return to your ContentView

I'm also not 100% sure what OP is after, but it seems to be a window that remains open when opening an immersive space.

I only looked into the sample app briefly, but it indeed uses the app's main window for navigation and content presentation, while the immersive space is presented. WWDC sessions seem to promote the full space only as an immersive experience, so I wasn't aware that this is even an encouraged use case.

Control center also offers a way to exit immersive scenes

For the first part of your question, test the built-in template called window when creating a new project. You will see that the 2d window does not disappear when you enter the immersive view. You can take a look at the code in the ContentView file that shows how this pipeline works.