diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 02:51:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 02:51:27 +0300 |
commit | 1a4595618c959da17ddec9cef839f8bf654f4727 (patch) | |
tree | 2d57d6cd75ff9d708cfc3adc19ba545f2046921b /source/blender/windowmanager/intern/wm_files.c | |
parent | f44a8bd25751c562ac5a79715c99f79533af3f9c (diff) |
Fix factory-settings using stale preferences
We need to reload defaults on factory startup because the defaults
now have preferences that may have changed.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 318147e8c25..6c86a67931b 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -956,6 +956,17 @@ int wm_homefile_read( /* match the read WM with current WM */ wm_window_match_do(C, &wmbase, &bmain->wm, &bmain->wm); + + if (use_factory_settings) { + /* Clear keymaps because the current default keymap may have been initialized from user preferences, + * which have been reset. */ + for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) { + if (wm->defaultconf) { + wm->defaultconf->flag &= ~KEYCONF_INIT_DEFAULT; + } + } + } + WM_check(C); /* opens window(s), checks keymaps */ bmain->name[0] = '\0'; |