Search Unity

Bug OpenXR on windows: OnApplicationFocus not called when system menu raised

Discussion in 'VR' started by DylanF, Mar 17, 2023.

  1. DylanF

    DylanF

    Joined:
    Jun 25, 2013
    Posts:
    55
    Tested with a Rift S and unity 2022.2.11 using openxr on windows.

    OnApplicationFocus (and OnApplicationPause) are not called when the VR system menu is up on windows (not in the editor or in a build). According to this official forum post, it should work:
    https://forum.unity.com/threads/uni...ves-the-hmd-or-opens-the-oculus-dash.1094062/

    When using oculus as the openxr provider, OnApplicationFocus is not run when the reserved system button is pressed. The input system can be used to capture the left menu button though.

    When using steamvr as the openxr provider, OnApplicationFocus is not run when either the System or Menu button are pressed. Also, the input system can't read either of those buttons in this scenario (by design) so there's no intuitive Pause button in this setup.

    There does not appear to be an OpenXRFeature to catch these system menu events.

    Solution: OnApplicationFocus should be called whenever a system menu of any kind is raised or lowered in desktop openxr. This should include when the left oculus menu button is used with steamvr to raise the steam menu.
     
    Last edited: Mar 17, 2023
  2. beardedlinuxgeek

    beardedlinuxgeek

    Joined:
    Nov 7, 2019
    Posts:
    5
    I also have this bug