diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-22 02:12:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-22 02:18:59 +0300 |
commit | 3e1baa7d539757b8e5fa870d4909354e0b5645b9 (patch) | |
tree | 4f557a747a061ca6df7455aaae123cc19204c958 /source/blender/windowmanager/intern/wm_toolsystem.c | |
parent | bdbaf0301df630cefd3f753c9419646b3f858588 (diff) |
Fix T92357: assert changing scenes while in edit mode
ScrArea.runtime.tool needs to be updated after switching scenes.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_toolsystem.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 0c24520d565..3ac1a7c0be1 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -572,25 +572,29 @@ void WM_toolsystem_refresh_screen_area(WorkSpace *workspace, ViewLayer *view_lay } } +void WM_toolsystem_refresh_screen_window(wmWindow *win) +{ + WorkSpace *workspace = WM_window_get_active_workspace(win); + bool space_type_has_tools[SPACE_TYPE_LAST + 1] = {0}; + LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { + space_type_has_tools[tref->space_type] = true; + } + bScreen *screen = WM_window_get_active_screen(win); + ViewLayer *view_layer = WM_window_get_active_view_layer(win); + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + area->runtime.tool = NULL; + area->runtime.is_tool_set = true; + if (space_type_has_tools[area->spacetype]) { + WM_toolsystem_refresh_screen_area(workspace, view_layer, area); + } + } +} + void WM_toolsystem_refresh_screen_all(Main *bmain) { /* Update all ScrArea's tools */ for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) { LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { - WorkSpace *workspace = WM_window_get_active_workspace(win); - bool space_type_has_tools[SPACE_TYPE_LAST + 1] = {0}; - LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { - space_type_has_tools[tref->space_type] = true; - } - bScreen *screen = WM_window_get_active_screen(win); - ViewLayer *view_layer = WM_window_get_active_view_layer(win); - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - area->runtime.tool = NULL; - area->runtime.is_tool_set = true; - if (space_type_has_tools[area->spacetype]) { - WM_toolsystem_refresh_screen_area(workspace, view_layer, area); - } - } } } } |