XR: Fix crash on executing some action operators

Since the XR area does not have any region geometry, hud updates from
operators would cause invalid access when updating region sizes.
This commit is contained in:
Peter Kim
2022-03-25 13:22:04 +09:00
parent 93f2ebe7dd
commit 315210c22b
3 changed files with 4 additions and 1 deletions

View File

@@ -1972,6 +1972,7 @@ void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
static void area_offscreen_init(ScrArea *area)
{
area->flag |= AREA_FLAG_OFFSCREEN;
area->type = BKE_spacetype_from_id(area->spacetype);
if (area->type == NULL) {

View File

@@ -540,6 +540,8 @@ enum {
AREA_FLAG_STACKED_FULLSCREEN = (1 << 7),
/** Update action zones (even if the mouse is not intersecting them). */
AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8),
/** For offscreen areas. */
AREA_FLAG_OFFSCREEN = (1 << 9),
};
#define AREAGRID 4

View File

@@ -1063,7 +1063,7 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat,
if (hud_status != NOP) {
if (hud_status == SET) {
ScrArea *area = CTX_wm_area(C);
if (area) {
if (area && ((area->flag & AREA_FLAG_OFFSCREEN) == 0)) {
ED_area_type_hud_ensure(C, area);
}
}