Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kim <pk15950@gmail.com>2022-03-25 07:22:04 +0300
committerPeter Kim <pk15950@gmail.com>2022-03-25 07:22:04 +0300
commit315210c22baea5e0da06cac7fee4c24a4b7d887f (patch)
tree4e82ec9dead85650ddfae3718a369ea8cd9d54c0
parent93f2ebe7ddb7f18a1bb72b4f65a26c9e2d26774a (diff)
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.
-rw-r--r--source/blender/editors/screen/area.c1
-rw-r--r--source/blender/makesdna/DNA_screen_types.h2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index af84f6f99a9..30bf23e0987 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -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) {
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index c8209b4d194..d32757cc868 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -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
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 790b08437bd..60ae4eccbbe 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -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);
}
}