WM: check modal handlers for keymap lookups
authorCampbell Barton <ideasman42@gmail.com>
Fri, 25 May 2018 08:51:05 +0000 (10:51 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 25 May 2018 08:51:05 +0000 (10:51 +0200)
Keep in sync with 2.8x

source/blender/windowmanager/intern/wm_keymap.c

index 39dd26339eb4a65b93a3c077cad5c6102d36358c..6a5b638437ea9090fbb3c59cc52b8d73ad284728 100644 (file)
@@ -1190,8 +1190,14 @@ static wmKeyMapItem *wm_keymap_item_find_props(
        wmKeyMapItem *found = NULL;
 
        /* look into multiple handler lists to find the item */
-       if (win)
-               found = wm_keymap_item_find_handlers(C, &win->handlers, opname, opcontext, properties, is_strict, is_hotkey, r_keymap);
+       if (win) {
+               found = wm_keymap_item_find_handlers(
+                       C, &win->modalhandlers, opname, opcontext, properties, is_strict, is_hotkey, r_keymap);
+               if (found == NULL) {
+                       found = wm_keymap_item_find_handlers(
+                               C, &win->handlers, opname, opcontext, properties, is_strict, is_hotkey, r_keymap);
+               }
+       }
 
        if (sa && found == NULL)
                found = wm_keymap_item_find_handlers(C, &sa->handlers, opname, opcontext, properties, is_strict, is_hotkey, r_keymap);