Commit: 535fec06612799c2355525fa5332780e2472caac
Author: Brecht Van Lommel
Date:   Wed Jul 4 18:22:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB535fec06612799c2355525fa5332780e2472caac

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.

===================================================================

M       source/blender/editors/screen/workspace_edit.c

===================================================================

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;
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to