How to dismiss an ImmersiveSpace when the main window closes?

I noticed that when I enter the fully immersive view and then click the X button below the window, the immersive space remains active, and the only way to dismiss it is to click the digital crown. On other apps (Disney+ for example), closing out of the main window while in immersive mode also closes out the immersive space. I tried applying an onDisappear modifier to the the Modules view with a dismissImmersiveSpace, but that doesn't appear to do anything. Any help would be appreciated.

Answered by DTS Engineer in 818868022

Hi,

Take a look at how this sample manages its UI.

Interacting with virtual content blended with passthrough.

Hi,

Take a look at how this sample manages its UI.

Interacting with virtual content blended with passthrough.

How to dismiss an ImmersiveSpace when the main window closes?
 
 
Q