diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-13 17:33:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-13 18:56:42 +0300 |
commit | 245129e8e2a6fb24b7a3c6623eae9a6b2010c238 (patch) | |
tree | f152b8032813d3ede98225c4171ed4b9bb4cb35f /source/blender | |
parent | 84936ce0ee51453a8690a41e8eda8c7d424c928e (diff) |
Fix T65445: wrong defaults when appending workspaces from builtin templates
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index cf00e4d5f84..8769ed37d16 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -40,6 +40,7 @@ struct Scene; struct UserDef; struct View3D; struct ViewLayer; +struct WorkSpace; struct bContext; struct bScreen; struct wmWindowManager; @@ -166,6 +167,7 @@ void BLO_expand_main(void *fdhandle, struct Main *mainvar); /* Update defaults in startup.blend & userprefs.blend, without having to save and embed it */ void BLO_update_defaults_userpref_blend(void); void BLO_update_defaults_startup_blend(struct Main *mainvar, const char *app_template); +void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_template); /* Version patch user preferences. */ void BLO_version_defaults_userpref_blend(struct Main *mainvar, struct UserDef *userdef); diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 617329ef5f2..355260f7b26 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -286,7 +286,7 @@ static void blo_update_defaults_screen(bScreen *screen, } } -static void blo_update_defaults_workspace(WorkSpace *workspace, const char *app_template) +void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_template) { ListBase *layouts = BKE_workspace_layouts_get(workspace); for (WorkSpaceLayout *layout = layouts->first; layout; layout = layout->next) { @@ -367,7 +367,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) { /* For all app templates. */ for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { - blo_update_defaults_workspace(workspace, app_template); + BLO_update_defaults_workspace(workspace, app_template); } /* For builtin templates only. */ diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 9fcd0e5295c..6030b6fded5 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -376,6 +376,9 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) BLI_assert(appended_workspace != NULL); if (appended_workspace) { + /* Set defaults. */ + BLO_update_defaults_workspace(appended_workspace, NULL); + /* Reorder to last position. */ BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); |