I have created a simple app that enters and exits an immersive space. I have not changed the basic code that gets created when you start a new visionOS project.
I have connected a Magic Mouse to the AVP using BT.
I have added a simple call to print(GCMouse.mice())
and I have also tried print(GCController.controllers())
when the RealityView is launched inside the body closure. If I do not have the GCMouse/GCController call, everything works fine.
However, with this perfect storm (Magic Mouse connected, enter immersive space, call GCMouse/GCController, exit immersive space) the onDisappear closure is never called, so I cannot reset my ToggleImmersiveSpace
button out of disabled state due to transition.
Once I power off and disconnect the mouse, the onDisappear
closure is finally called.
I have attempted to profile the issue, and I see that right before the onDisappear is called after the controllers are disconnected (which is long after the dismissImmersiveSpace
was called), I see two mentions of some deallocation/destruction of GameController:
-[GCMouse.cxx_destruct]
-[GCPhysicalInputProfile(Pooling) release]