From f149d5e4b21f372f779fdb28b39984355c9682a6 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 31 Mar 2020 16:39:59 +0200 Subject: 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. --- source/blender/windowmanager/intern/wm_operators.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index e782b802729..c3446a016f1 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -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) -- cgit v1.2.3