Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
delphinius81's avatar
delphinius81
Rising Star
9 years ago

Windows/VR Focus in Unity

We submitted our app (finally - woo!) earlier in the week and received some test results today. Under the Reserved Actions set of tests, we failed the VR and Windows focus test.

The feedback was:

Your app does not have VR and Windows focus. A variety of the following elements might not be working as intended: 1) music/sound play, 2) user input not working, 3) not rendering at 90hz and/or 4) we did not see hour glass loading except during startup or loading screens. Pressing Alt+Tab while the game is running causes it to become unresponsive to user input.

The wording of this feedback is a little confusing, because it does not actually state what the intended behavior is supposed to be in cases where:

VR has focus, Windows does not have focus (though PC docs suggest what to do in this case)
VR does not have focus, Windows has focus
VR and Windows do not have focus

However, for the other cases, what exactly should happen? Is it more of just a case of handling if VR has focus or not, since we are supposed to ignore Windows focus so long as the hmd is mounted?

In that case, what have other people done within Unity to handle this. For example, alt-tabbing while the user still has the HMD on - how would I have my app ignore this loss of Windows focus?

2 Replies

Replies have been turned off for this discussion
  • Which version of Unity are you using? As far as I know, Unity 5 should handle the VR focus issues for you automatically. 
  • The submitted build was using 5.4.0f3 - just updated to 5.4.0p1. I have some code that checks for vrfocus and pauses the app/audio and disables input when vrfocus is lost and should all get reenabled once vrfocus is gained again (which I think is the desired behavior). I think it could maybe be an issue with alt-tabbing or losing window focus then, but with the generic feedback response it's really hard to figure out what needs to be fixed.

    Part of the issue here is that it isn't clear what exactly failed and what the desired behavior is even supposed to be. Was planning on emailing submissions@ tomorrow to try and get more details - only had access to a DK2 today so I couldn't fully check all the use cases.