WM: load UI for new file, even when pref disabled

Loading startup file always loads the UI now.
This commit is contained in:
Campbell Barton 2017-08-13 01:05:10 +10:00
parent d7639d57dc
commit b500f42700
2 changed files with 5 additions and 5 deletions

@ -114,6 +114,7 @@ static void setup_app_data(
const char *filepath, ReportList *reports) const char *filepath, ReportList *reports)
{ {
Scene *curscene = NULL; Scene *curscene = NULL;
const bool is_startup = (bfd->filename[0] == '\0');
const bool recover = (G.fileflags & G_FILE_RECOVER) != 0; const bool recover = (G.fileflags & G_FILE_RECOVER) != 0;
enum { enum {
LOAD_UI = 1, LOAD_UI = 1,
@ -129,7 +130,7 @@ static void setup_app_data(
else if (BLI_listbase_is_empty(&bfd->main->screen)) { else if (BLI_listbase_is_empty(&bfd->main->screen)) {
mode = LOAD_UNDO; mode = LOAD_UNDO;
} }
else if (G.fileflags & G_FILE_NO_UI) { else if ((G.fileflags & G_FILE_NO_UI) && (is_startup == false)) {
mode = LOAD_UI_OFF; mode = LOAD_UI_OFF;
} }
else { else {
@ -250,7 +251,9 @@ static void setup_app_data(
CTX_data_scene_set(C, curscene); CTX_data_scene_set(C, curscene);
} }
else { else {
G.fileflags = bfd->fileflags; /* Keep state from preferences. */
const int fileflags_skip = G_FILE_FLAGS_RUNTIME;
G.fileflags = (G.fileflags & fileflags_skip) | (bfd->fileflags & ~fileflags_skip);
CTX_wm_manager_set(C, G.main->wm.first); CTX_wm_manager_set(C, G.main->wm.first);
CTX_wm_screen_set(C, bfd->curscreen); CTX_wm_screen_set(C, bfd->curscreen);
CTX_data_scene_set(C, bfd->curscene); CTX_data_scene_set(C, bfd->curscene);

@ -184,9 +184,6 @@ void WM_init(bContext *C, int argc, const char **argv)
BLF_init(); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */ BLF_init(); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */
BLT_lang_init(); BLT_lang_init();
/* Enforce loading the UI for the initial homefile */
G.fileflags &= ~G_FILE_NO_UI;
/* reports cant be initialized before the wm, /* reports cant be initialized before the wm,
* but keep before file reading, since that may report errors */ * but keep before file reading, since that may report errors */
wm_init_reports(C); wm_init_reports(C);