diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-27 10:22:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-27 10:22:05 +0300 |
commit | 3366b333e49dd0623c3c68c2c04aac66e5028be9 (patch) | |
tree | 2623ca146c586ab7d0bbc3f7183060cb44ed3f0f /source/blender/windowmanager/intern/wm_toolsystem.c | |
parent | d3f9a722feee2175074a0576471b28e2484e7765 (diff) |
Fix switching tools with multiple windows & gizmos
The gizmo would only added if the gizmo type wasn't already linked.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_toolsystem.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 51b44b630cf..f40ea55ee82 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -177,7 +177,12 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(idname, false); if (gzgt != NULL) { if ((gzgt->flag & WM_GIZMOGROUPTYPE_TOOL_INIT) == 0) { - WM_gizmo_group_type_ensure_ptr(gzgt); + if (!WM_gizmo_group_type_ensure_ptr(gzgt)) { + /* Even if the group-type was has been linked, it's possible the space types + * were not previously using it. (happens with multiple windows.) */ + wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gzgt->gzmap_params); + WM_gizmoconfig_update_tag_init(gzmap_type, gzgt); + } } } else { |