[Bf-blender-cvs] [f01ec6e27e] workspaces: Allow changing to workspace that's open in another window

Julian Eisel noreply at git.blender.org
Tue Mar 14 13:00:30 CET 2017


Commit: f01ec6e27ec977bd03dc7b6ade9cfa15661d9007
Author: Julian Eisel
Date:   Tue Mar 14 11:42:37 2017 +0100
Branches: workspaces
https://developer.blender.org/rBf01ec6e27ec977bd03dc7b6ade9cfa15661d9007

Allow changing to workspace that's open in another window

This needs more work still.

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

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

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

diff --git a/source/blender/editors/workspace/workspace_edit.c b/source/blender/editors/workspace/workspace_edit.c
index 90229ba74f..c950b72139 100644
--- a/source/blender/editors/workspace/workspace_edit.c
+++ b/source/blender/editors/workspace/workspace_edit.c
@@ -118,6 +118,11 @@ bool ED_workspace_change(bContext *C, wmWindowManager *wm, wmWindow *win, WorkSp
 	WorkSpaceLayout *layout_new = BKE_workspace_layouts_get(workspace_new)->first;
 	bScreen *screen_new = BKE_workspace_layout_screen_get(layout_new);
 
+	if (screen_new->winid) {
+		/* screen is already used */
+		layout_new = ED_workspace_layout_duplicate(workspace_new, layout_new, win);
+		screen_new = BKE_workspace_layout_screen_get(layout_new);
+	}
 	screen_new = screen_change_prepare(screen_old, screen_new, bmain, C, win);
 
 	if (screen_new) {




More information about the Bf-blender-cvs mailing list