diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-05 04:53:37 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-05 04:53:37 +0400 |
commit | 3ad13869fe2d96d9ca846a4ca7318c2e368e505b (patch) | |
tree | 96845673300799d66d923bd4cb541dc07ae0848d /source/blender/windowmanager/intern/wm_keymap.c | |
parent | 5734d229a873dd873f30b7467c3ca81863c22c84 (diff) |
Fix #34862: some operators like mesh separate or object clear parent were not
showing shortcuts in menus, now it shows them in the submenu.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 886003d2f74..aa9af4af154 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -101,7 +101,7 @@ static int wm_keymap_item_equals_result(wmKeyMapItem *a, wmKeyMapItem *b) if (strcmp(a->idname, b->idname) != 0) return 0; - if (!RNA_struct_equals(a->ptr, b->ptr)) + if (!RNA_struct_equals(a->ptr, b->ptr, true)) return 0; if ((a->flag & KMI_INACTIVE) != (b->flag & KMI_INACTIVE)) @@ -874,9 +874,14 @@ static wmKeyMapItem *wm_keymap_item_find_handlers( } #endif - if (kmi->ptr && IDP_EqualsProperties_ex(properties, kmi->ptr->data, is_strict)) { - if (keymap_r) *keymap_r = keymap; - return kmi; + if (kmi->ptr) { + PointerRNA properties_ptr; + RNA_pointer_create(NULL, kmi->ptr->type, properties, &properties_ptr); + + if (RNA_struct_equals(&properties_ptr, kmi->ptr, is_strict)) { + if (keymap_r) *keymap_r = keymap; + return kmi; + } } } else { @@ -958,7 +963,12 @@ static wmKeyMapItem *wm_keymap_item_find( RNA_pointer_create(NULL, ot->srna, properties_default, &opptr); - if (WM_operator_properties_default(&opptr, true)) { + if (WM_operator_properties_default(&opptr, true) || + (ot->prop && RNA_property_is_set(&opptr, ot->prop))) { + /* for operator that has enum menu, unset it so it always matches */ + if (ot->prop) + RNA_property_unset(&opptr, ot->prop); + found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, 0, hotkey, keymap_r); } |