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:
authorCampbell Barton <campbell@blender.org>2022-05-06 10:49:29 +0300
committerCampbell Barton <campbell@blender.org>2022-05-06 10:49:29 +0300
commitae9ef281265a4dc2d1fc77783a012211895bc8d0 (patch)
tree598cf7fdab607ef29ed89141cf6bc36022000a1c
parente58b18888c0e76a9ab8b0eeb16cdad9d9d9962cf (diff)
parent62450e8485ded339889e292e41453398dad5adcc (diff)
Merge branch 'blender-v3.2-release'
-rw-r--r--source/blender/windowmanager/WM_toolsystem.h5
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/windowmanager/WM_toolsystem.h b/source/blender/windowmanager/WM_toolsystem.h
index a9e1495d9bf..96094e9e7ef 100644
--- a/source/blender/windowmanager/WM_toolsystem.h
+++ b/source/blender/windowmanager/WM_toolsystem.h
@@ -28,6 +28,11 @@ struct wmOperatorType;
#define WM_TOOLSYSTEM_SPACE_MASK \
((1 << SPACE_IMAGE) | (1 << SPACE_NODE) | (1 << SPACE_VIEW3D) | (1 << SPACE_SEQ))
+/**
+ * Space-types that define their own "mode" (as returned by #WM_toolsystem_mode_from_spacetype).
+ */
+#define WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE ((1 << SPACE_IMAGE) | (1 << SPACE_SEQ))
+
/* Values that define a category of active tool. */
typedef struct bToolKey {
int space_type;
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index 8c7cf86d050..984a8ef41d0 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -636,7 +636,8 @@ bToolRef *WM_toolsystem_ref_set_by_id_ex(
/* Some contexts use the current space type (image editor for e.g.),
* ensure this is set correctly or there is no area. */
#ifndef NDEBUG
- {
+ /* Exclude this check for some space types where the space type isn't used. */
+ if ((1 << tkey->space_type) & WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE) {
ScrArea *area = CTX_wm_area(C);
BLI_assert(area == NULL || area->spacetype == tkey->space_type);
}