diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-11-09 07:37:09 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-11-09 17:11:57 +0300 |
commit | fadbb2fde8c2a6814f8d8edf577ea1d71879b4db (patch) | |
tree | f872b67992797f5dcab006d8e3f6aa51088253f9 /source | |
parent | 5839c73a5414e5e654e4fb202751ccff7e414594 (diff) |
Fix crash using pre 2.5 file as startup.blend
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 7 |
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)); |