How to Move and Rotate WindowGroup with Code in Xcode

When entering the mixed space, there is a window behind the robot, and I want this window to be moved to another position as code

Answered by radicalappdev in 831275022

Unfortunately, that isn't possible in visionOS. We do not have programmatic access to window positions. Only the user can move or reposition windows and volumes.

The closest we can get is setting initial position using defaultWindowPlacement.

Many of us have already filed feedback requesting access to move windows and volumes. Hopefully we'll see some changes in visionOS 3.

As a workaround, you could close your main window and use attachments when inside the immersive space. You can position these just like entities. However, this can come with more work. You'll need to decide how to move from the window to the space and back (scene phase can help here)

Accepted Answer

Unfortunately, that isn't possible in visionOS. We do not have programmatic access to window positions. Only the user can move or reposition windows and volumes.

The closest we can get is setting initial position using defaultWindowPlacement.

Many of us have already filed feedback requesting access to move windows and volumes. Hopefully we'll see some changes in visionOS 3.

As a workaround, you could close your main window and use attachments when inside the immersive space. You can position these just like entities. However, this can come with more work. You'll need to decide how to move from the window to the space and back (scene phase can help here)

How to Move and Rotate WindowGroup with Code in Xcode
 
 
Q