From b708917d94afa3a77be5e571b1c36a364d2ec6b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 2 Jul 2019 10:19:06 +1000 Subject: [PATCH] Fix T66316: "Open on Mouse Over" doesn't work in some popovers Popovers created from `UILayout.prop_with_popover` opening on mouse-over. --- source/blender/editors/interface/interface_handlers.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b6c064ab1c1..8ed3f077cbc 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7293,7 +7293,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s button_tooltip_timer_reset(C, but); /* automatic open pulldown block timer */ - if (ELEM(but->type, UI_BTYPE_BLOCK, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER)) { + if (ELEM(but->type, UI_BTYPE_BLOCK, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU)) { if (data->used_mouse && !data->autoopentimer) { int time; @@ -10117,9 +10117,10 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE if ((data->state == BUTTON_STATE_MENU_OPEN) && /* make sure mouse isn't inside another menu (see T43247) */ - (is_inside_menu == false) && (ELEM(but->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER)) && + (is_inside_menu == false) && + (ELEM(but->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU)) && (but_other = ui_but_find_mouse_over(ar, event)) && (but != but_other) && - (ELEM(but_other->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER))) { + (ELEM(but_other->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU))) { /* if mouse moves to a different root-level menu button, * open it to replace the current menu */ if ((but_other->flag & UI_BUT_DISABLED) == 0) {