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:
authorJulian Eisel <eiseljulian@gmail.com>2017-11-09 07:37:09 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-11-09 17:11:57 +0300
commitfadbb2fde8c2a6814f8d8edf577ea1d71879b4db (patch)
treef872b67992797f5dcab006d8e3f6aa51088253f9 /source/blender/windowmanager
parent5839c73a5414e5e654e4fb202751ccff7e414594 (diff)
Fix crash using pre 2.5 file as startup.blend
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 5b2734eaf9e..dbc189c6c40 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -52,6 +52,7 @@
#include "BKE_screen.h"
#include "BKE_report.h"
#include "BKE_global.h"
+#include "BKE_workspace.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -433,12 +434,14 @@ void wm_add_default(Main *bmain, bContext *C)
wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
wmWindow *win;
bScreen *screen = CTX_wm_screen(C); /* XXX from file read hrmf */
- struct WorkSpace *workspace = G.main->workspaces.last;
+ WorkSpace *workspace;
+ WorkSpaceLayout *layout = BKE_workspace_layout_find_global(bmain, screen, &workspace);
CTX_wm_manager_set(C, wm);
win = wm_window_new(C);
+ win->scene = CTX_data_scene(C);
WM_window_set_active_workspace(win, workspace);
- WM_window_set_active_screen(win, workspace, screen);
+ WM_window_set_active_layout(win, workspace, layout);
screen->winid = win->winid;
BLI_strncpy(win->screenname, screen->id.name + 2, sizeof(win->screenname));