[Bf-blender-cvs] [d2f4fc8275d] master: WM: support loading keymaps in background mode

Campbell Barton noreply at git.blender.org
Sun Mar 14 08:00:55 CET 2021


Commit: d2f4fc8275d4df6e585815757c69c762412bfa65
Author: Campbell Barton
Date:   Sun Mar 14 18:00:15 2021 +1100
Branches: master
https://developer.blender.org/rBd2f4fc8275d4df6e585815757c69c762412bfa65

WM: support loading keymaps in background mode

While this still isn't done by default on startup,
activating a key-config will load it as expected.

Needed to perform key-map loading tests in background mode.

===================================================================

M	source/blender/windowmanager/intern/wm.c
M	source/blender/windowmanager/intern/wm_keymap.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index b66544831f1..3f1bbb7a669 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -473,7 +473,10 @@ void WM_keyconfig_init(bContext *C)
       wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
     }
 
-    WM_keyconfig_update_tag(NULL, NULL);
+    /* Harmless, but no need to update in background mode. */
+    if (!G.background) {
+      WM_keyconfig_update_tag(NULL, NULL);
+    }
     WM_keyconfig_update(wm);
 
     wm->initialized |= WM_KEYCONFIG_IS_INIT;
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 6cc9a4c9b64..1b4908224cc 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -1773,10 +1773,6 @@ void WM_keyconfig_update(wmWindowManager *wm)
 {
   bool compat_update = false;
 
-  if (G.background) {
-    return;
-  }
-
   if (wm_keymap_update_flag == 0) {
     return;
   }



More information about the Bf-blender-cvs mailing list