Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
darkveins_'s avatar
darkveins_
Protege
6 months ago

Unity OpenXR Meta regression: passthrough doesn't work when focus is lost and regained

Problem:
1. Passthrough initially works fine in the app.
2. Take the headset off, the display goes dark.
3. Put the headset back on, the display turns back on.
4. Unexpected: passthrough no longer works in the app!

Also, passthrough doesn't work in the first run after the app has been installed.

This is a regression. Passthrough always worked in the last version of the Unity OpenXR Meta package I used, which I think was 2.0.1.

Suspected Cause:
MetaOpenXRPassthroughLayer.Dispose()
in the Unity OpenXR Meta package appears to be broken - it's not idempotent.
When Unity's OpenXRCompositionLayersFeature.OnSessionEnd() disposes it, the underlying resources are gone for good.
So when OpenXRCompositionLayersFeature.OnSessionBegin() creates a new one, it doesn't work.

Version:
Unity 6 (6000.0.51f1)
My selected XR plugin: Unity OpenXR Meta 2.2.0
Meta Quest 3

I think these packages are irrelevant to this problem, but including the versions anyway:
Meta XR Core SDK 77.0.0
Meta MR Utility Kit v77.0.0
Meta XR Platform SDK 77.0.0

2 Replies

Replies have been turned off for this discussion
  • Yeah, this seems to be a known issue with recent Meta/Unity OpenXR integrations. When the app loses and regains focus (like when removing the headset), the passthrough layer can fail to reinitialize properly. A temporary workaround is to manually re-enable the passthrough feature in code when focus is regained — you can hook into Unity’s OnApplicationFocus or OnApplicationPause. Hopefully, Meta or Unity will patch this in an upcoming release!"

    • darkveins_'s avatar
      darkveins_
      Protege

      Unfortunately, hooking into OnApplicationFocus doesn't work. The passthrough layer has already been improperly disposed of by the time this Unity method is invoked.

       I worked around this regression by creating a custom OpenXR composition layers feature. But it's a rather low-level solution that I don't imagine most devs are going to do.