diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-04 19:22:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-04 19:40:33 +0300 |
commit | 535fec06612799c2355525fa5332780e2472caac (patch) | |
tree | 3d6846489e2efa5fd6e29a547f6caee0f2c44a5b | |
parent | c43443d530bff67693dc2db4efdca6307703ce61 (diff) |
Workspaces: change behavior when window layout for workspace is missing.
When switching the workspace in a window that does not yet have a layout
for the newly active workspace, we now duplicate the layout from the
previously active workspace. Previously it duplicated the layout from
the first window in the newly active workspace.
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 705d8992900..e54a764faa7 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -112,6 +112,7 @@ static WorkSpaceLayout *workspace_change_get_new_layout( Main *bmain, WorkSpace *workspace_new, wmWindow *win) { /* ED_workspace_duplicate may have stored a layout to activate once the workspace gets activated. */ + WorkSpaceLayout *layout_old = WM_window_get_active_layout(win); WorkSpaceLayout *layout_new; bScreen *screen_new; @@ -132,8 +133,8 @@ static WorkSpaceLayout *workspace_change_get_new_layout( workspace_new, layout_new, workspace_change_find_new_layout_cb, NULL, false); if (!layout_temp) { - /* fallback solution: duplicate layout */ - layout_temp = ED_workspace_layout_duplicate(bmain, workspace_new, layout_new, win); + /* fallback solution: duplicate layout from old workspace */ + layout_temp = ED_workspace_layout_duplicate(bmain, workspace_new, layout_old, win); } layout_new = layout_temp; } |