Hello,
You could try making use of scene phases to alert the app when the parent window is being closed.
See https://developer.apple.com/documentation/swiftui/scenephase
Unfortunately, this approach doesn't work for us consistently in Immersive Space.
In Vision 26, we have some additional tools available. Check out .restorationBehavior and .defaultLaunchBehavior described in this document. https://developer.apple.com/documentation/visionos/adopting-best-practices-for-scene-restoration/
Good luck!
Topic:
Spatial Computing
SubTopic:
General
Tags: