Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-08 17:22:26 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-08 17:22:26 +0400
commitff0a452a8a49a9bcd5a3fd9f96e240425e267aa6 (patch)
tree09650a77efe7c3813c6f1b1c3febdc6587dfc886 /source/blender/windowmanager/intern/wm_keymap.c
parent41703b851dfff378fbd0bd652d4c5ded55a07743 (diff)
Fix #28310: import of key configuration with modal keymap not working.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 0e94ad72d35..854fa688ea4 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -47,6 +47,7 @@
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
+#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_screen.h"
@@ -680,6 +681,17 @@ wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, EnumPrope
wmKeyMap *km= WM_keymap_find(keyconf, idname, 0, 0);
km->flag |= KEYMAP_MODAL;
km->modal_items= items;
+
+ if(!items) {
+ /* init modal items from default config */
+ wmWindowManager *wm = G.main->wm.first;
+ wmKeyMap *defaultkm= WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, 0, 0);
+
+ if(defaultkm) {
+ km->modal_items = defaultkm->modal_items;
+ km->poll = defaultkm->poll;
+ }
+ }
return km;
}