diff options
Diffstat (limited to 'source/blender/windowmanager/xr/intern/wm_xr.c')
-rw-r--r-- | source/blender/windowmanager/xr/intern/wm_xr.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/windowmanager/xr/intern/wm_xr.c b/source/blender/windowmanager/xr/intern/wm_xr.c index 8891840cb75..36bd03ed3ea 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr.c +++ b/source/blender/windowmanager/xr/intern/wm_xr.c @@ -24,19 +24,22 @@ #include "BKE_global.h" #include "BKE_idprop.h" +#include "BKE_main.h" #include "BKE_report.h" +#include "DEG_depsgraph.h" + #include "DNA_scene_types.h" #include "DNA_windowmanager_types.h" -#include "DEG_depsgraph.h" - -#include "MEM_guardedalloc.h" +#include "ED_screen.h" #include "GHOST_C-api.h" #include "GPU_platform.h" +#include "MEM_guardedalloc.h" + #include "WM_api.h" #include "wm_surface.h" @@ -137,7 +140,7 @@ bool wm_xr_events_handle(wmWindowManager *wm) /* Process OpenXR action events. */ if (WM_xr_session_is_ready(&wm->xr)) { - wm_xr_session_actions_update(&wm->xr); + wm_xr_session_actions_update(wm); } /* wm_window_process_events() uses the return value to determine if it can put the main thread @@ -172,6 +175,12 @@ void wm_xr_runtime_data_free(wmXrRuntimeData **runtime) * first call, see comment above. */ (*runtime)->context = NULL; + if ((*runtime)->area) { + wmWindowManager *wm = G_MAIN->wm.first; + wmWindow *win = wm_xr_session_root_window_or_fallback_get(wm, (*runtime)); + ED_area_offscreen_free(wm, win, (*runtime)->area); + (*runtime)->area = NULL; + } wm_xr_session_data_free(&(*runtime)->session_state); WM_xr_actionmaps_clear(*runtime); |