Lost focus in play mode stops HMD input with XR

I’m running an application using XR with oculus quest 2 inside the editor using Play. I have “run in background” set. Both with player setting and in script (just to be sure). When the play mode is enabled and it lose focus position and rotation from the HMD stops updating. A couple of seconds of that with headset makes me seriously uncomfortable. I’m using only new I out system.

Running in background works fine if I build the application and run it standalone.

Is this expected behavior or a bug with XR or or possible the oculus integration?

“it lose focus position and rotation from the HMD” - does that mean you take it of your head or what does it mean? Why should it stop updating if you still have it on your head, and if so it should not make you uncomfortable.

This is my code with Unity 2020.1.13f1. New XR plugin.

//get user present
UnityEngine.XR.InputDevice headDevice = InputDevices.GetDeviceAtXRNode(XRNode.Head);
bool presenceFeatureSupported = headDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.userPresence, out bool userPresent);
//pause if in oculus home universal menu
// but for now (for debug purposes) keep the game running while !userPresent
bool bPauseNow = (!OVRPlugin.hasInputFocus || !OVRPlugin.hasVrFocus) /*|| !userPresent)*/;
//bPauseNow = false; //to play from editor without wearing the VR headset when connected

Maybe you can use some of it?