diff options
4 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 288fa92da38..400070f12fc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9609,6 +9609,9 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) /* Don't read the active app template, use the default one. */ user->app_template[0] = '\0'; + /* Clear runtime data. */ + user->runtime.is_dirty = false; + /* free fd->datamap again */ oldnewmap_free_unused(fd->datamap); oldnewmap_clear(fd->datamap); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 3cc478c99f2..7edf581d2ee 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7575,8 +7575,9 @@ static void button_activate_exit( } /* Not very elegant, but ensures preference changes force re-save. */ - if (but->rnaprop && (but->rnapoin.data == &U)) { + if (but->rnaprop && (but->rnapoin.data == &U) && !RNA_property_update_check(but->rnaprop)) { U.runtime.is_dirty = true; + WM_main_add_notifier(NC_WINDOW, NULL); } } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 5198d89bda8..1e5d59c1491 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -184,6 +184,13 @@ static void rna_userdef_version_get(PointerRNA *ptr, int *value) value[2] = userdef->subversionfile; } +static void rna_userdef_ui_update(Main *UNUSED(bmain), + Scene *UNUSED(scene), + PointerRNA *UNUSED(ptr)) +{ + WM_main_add_notifier(NC_WINDOW, NULL); +} + static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { /* We can't use 'ptr->data' because this update function @@ -5591,7 +5598,7 @@ void RNA_def_userdef(BlenderRNA *brna) RNA_def_property_enum_items(prop, preference_section_items); RNA_def_property_ui_text( prop, "Active Section", "Active section of the preferences shown in the user interface"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); + RNA_def_property_update(prop, 0, "rna_userdef_ui_update"); /* don't expose this directly via the UI, modify via an operator */ prop = RNA_def_property(srna, "app_template", PROP_STRING, PROP_NONE); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 9abfa657536..797a2edd937 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -475,7 +475,7 @@ void WM_exit_ext(bContext *C, const bool do_python) ED_screen_exit(C, win, WM_window_get_active_screen(win)); } - if (U.runtime.is_dirty) { + if (U.runtime.is_dirty && !G.background) { if (U.pref_flag & USER_PREF_FLAG_SAVE) { BKE_blendfile_userdef_write_all(NULL); } |