diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_toolsystem.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 1ea39dcd6e0..0ba640fd6cc 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -729,9 +729,8 @@ static bToolRef *toolsystem_reinit_ensure_toolref(bContext *C, return tref; } -void WM_toolsystem_update_from_context_view3d(bContext *C) +static void wm_toolsystem_update_from_context_view3d_impl(bContext *C, WorkSpace *workspace) { - WorkSpace *workspace = CTX_wm_workspace(C); ViewLayer *view_layer = CTX_data_view_layer(C); int space_type = SPACE_VIEW3D; const bToolKey tkey = { @@ -741,6 +740,37 @@ void WM_toolsystem_update_from_context_view3d(bContext *C) toolsystem_reinit_ensure_toolref(C, workspace, &tkey, NULL); } +void WM_toolsystem_update_from_context_view3d(bContext *C) +{ + WorkSpace *workspace = CTX_wm_workspace(C); + wm_toolsystem_update_from_context_view3d_impl(C, workspace); + + /* Multi window support. */ + Main *bmain = CTX_data_main(C); + wmWindowManager *wm = bmain->wm.first; + if (!BLI_listbase_is_single(&wm->windows)) { + wmWindow *win_prev = CTX_wm_window(C); + ScrArea *area_prev = CTX_wm_area(C); + ARegion *ar_prev = CTX_wm_region(C); + + for (wmWindow *win = wm->windows.first; win; win = win->next) { + if (win != win_prev) { + WorkSpace *workspace_iter = WM_window_get_active_workspace(win); + if (workspace_iter != workspace) { + + CTX_wm_window_set(C, win); + + wm_toolsystem_update_from_context_view3d_impl(C, workspace_iter); + + CTX_wm_window_set(C, win_prev); + CTX_wm_area_set(C, area_prev); + CTX_wm_region_set(C, ar_prev); + } + } + } + } +} + void WM_toolsystem_update_from_context(bContext *C, WorkSpace *workspace, ViewLayer *view_layer, |