Fix #145808: Video Editing workspace does not set default tool

When a new workspace is appended into the current file, code tries to
set the active tool. As of #140271, an added check meant that if there
was no sequencer scene yet, no tool would be initialized with
`WM_toolsystem_update_from_context`.

In actuality, the scene and view layer that are passed into this
function are only used by the View3D space in
`WM_toolsystem_mode_from_spacetype`, so we don't need a special case at
all. Just revert to previous behavior to fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/145860
This commit is contained in:
John Kiril Swenson
2025-09-07 18:33:11 +02:00
committed by John Kiril Swenson
parent ec94e83ffa
commit b67d44fc70

View File

@@ -988,17 +988,8 @@ static void wm_draw_area_offscreen(bContext *C, wmWindow *win, ScrArea *area, bo
if (area->flag & AREA_FLAG_ACTIVE_TOOL_UPDATE) {
if ((1 << area->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) {
if (area->spacetype == SPACE_SEQ) {
Scene *scene = CTX_data_sequencer_scene(C);
if (scene) {
WM_toolsystem_update_from_context(
C, CTX_wm_workspace(C), scene, BKE_view_layer_default_render(scene), area);
}
}
else {
WM_toolsystem_update_from_context(
C, CTX_wm_workspace(C), CTX_data_scene(C), CTX_data_view_layer(C), area);
}
WM_toolsystem_update_from_context(
C, CTX_wm_workspace(C), CTX_data_scene(C), CTX_data_view_layer(C), area);
}
area->flag &= ~AREA_FLAG_ACTIVE_TOOL_UPDATE;
}