Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-04 19:22:29 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-04 19:40:33 +0300
commit535fec06612799c2355525fa5332780e2472caac (patch)
tree3d6846489e2efa5fd6e29a547f6caee0f2c44a5b /source/blender/editors/screen/workspace_edit.c
parentc43443d530bff67693dc2db4efdca6307703ce61 (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.
Diffstat (limited to 'source/blender/editors/screen/workspace_edit.c')
-rw-r--r--source/blender/editors/screen/workspace_edit.c5
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;
}