From 36d09d9029c970de6a6c4d926fc1189865b145c3 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 4 Feb 2020 12:06:21 +0100 Subject: Fix T67084: Modal keymaps could show the wrong shortcut WM_modalkeymap_operator_items_to_string() wasnt checking WM_keymap_active(), so it was possible that e.g. when using the Industry Compatible keymap, the shortcut from the Blender keymap was shown. This also fixes the (now exposed) bug that the Industry Compatible keymap would not have a ADD_CUT_CLOSED kmi defined for the Knife Tool [mandatory for the status bar]. Maniphest Tasks: T67084 Differential Revision: https://developer.blender.org/D6748 --- source/blender/windowmanager/intern/wm_keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager/intern/wm_keymap.c') diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 1809a233ce1..1587f7ab71d 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -1295,7 +1295,9 @@ int WM_modalkeymap_operator_items_to_string(wmOperatorType *ot, char *result, const int result_len) { - return WM_modalkeymap_items_to_string(ot->modalkeymap, propvalue, compact, result, result_len); + wmWindowManager *wm = G_MAIN->wm.first; + wmKeyMap *keymap = WM_keymap_active(wm, ot->modalkeymap); + return WM_modalkeymap_items_to_string(keymap, propvalue, compact, result, result_len); } char *WM_modalkeymap_operator_items_to_string_buf(wmOperatorType *ot, -- cgit v1.2.3