On visionOS, I have discovered that if dismissWindow
is followed immediately by a call to openWindow
, the new window does not open where the user is looking at. Instead, it appears at the same location as the dismissed window. However, if I open the new window after a small delay, or after UIScene's willDeactivateNotification
, the new window correctly opens in front of the user. (I tested this within a opened immersive space.)
Does this imply that dismissWindow
is actually asynchronous, in the sense that it requires extra time to reset certain internal states before the next openWindow
can be called? What is the best practice to close a window, then open a new window in front of the user's current head position?