From e31b8303ed17f19521acb90c5dd6c58ade807821 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 May 2018 10:45:48 +0200 Subject: [PATCH 1/2] UI: fix assert Replace hard-coded button size check with UI_UNIT_X. Caused icon-only buttons to have strings assigned based on UI-scale. --- source/blender/editors/interface/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 882d7de9af9..1d798c7baad 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2924,7 +2924,7 @@ void ui_but_update_ex(uiBut *but, const bool validate) switch (but->type) { case UI_BTYPE_MENU: - if (BLI_rctf_size_x(&but->rect) > 24.0f) { + if (BLI_rctf_size_x(&but->rect) >= (UI_UNIT_X * 2)) { /* only needed for menus in popup blocks that don't recreate buttons on redraw */ if (but->block->flag & UI_BLOCK_LOOP) { if (but->rnaprop && (RNA_property_type(but->rnaprop) == PROP_ENUM)) { From 9812943931b06a078945820abff381dfe4a020cf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 May 2018 10:51:05 +0200 Subject: [PATCH 2/2] WM: check modal handlers for keymap lookups Keep in sync with 2.8x --- source/blender/windowmanager/intern/wm_keymap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 39dd26339eb..6a5b638437e 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -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);