Fix VR session toggle not changing reliably on session start/end
The text and icon were supposed to change but didn't reliably, which was a race condition I think. It depended on how fast the OpenXR runtime would transition the session state. This also makes sure the correct notifier is sent on session exit.
This commit is contained in:
@@ -38,7 +38,7 @@ static bool rna_XrSessionState_is_running(bContext *C)
|
||||
{
|
||||
# ifdef WITH_XR_OPENXR
|
||||
const wmWindowManager *wm = CTX_wm_manager(C);
|
||||
return WM_xr_session_is_ready(&wm->xr);
|
||||
return WM_xr_session_exists(&wm->xr);
|
||||
# else
|
||||
UNUSED_VARS(C);
|
||||
return false;
|
||||
|
@@ -3711,6 +3711,8 @@ static void wm_xr_session_update_screen(Main *bmain, const wmXrData *xr_data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WM_main_add_notifier(NC_WM | ND_XR_DATA_CHANGED, NULL);
|
||||
}
|
||||
|
||||
static void wm_xr_session_update_screen_on_exit_cb(const wmXrData *xr_data)
|
||||
|
Reference in New Issue
Block a user