Fix T66316: "Open on Mouse Over" doesn't work in some popovers

Popovers created from `UILayout.prop_with_popover` opening on mouse-over.
This commit is contained in:
2019-07-02 10:19:06 +10:00
parent df330ab2bb
commit b708917d94

View File

@@ -7293,7 +7293,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
button_tooltip_timer_reset(C, but); button_tooltip_timer_reset(C, but);
/* automatic open pulldown block timer */ /* 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) { if (data->used_mouse && !data->autoopentimer) {
int time; 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) && if ((data->state == BUTTON_STATE_MENU_OPEN) &&
/* make sure mouse isn't inside another menu (see T43247) */ /* 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) && (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, /* if mouse moves to a different root-level menu button,
* open it to replace the current menu */ * open it to replace the current menu */
if ((but_other->flag & UI_BUT_DISABLED) == 0) { if ((but_other->flag & UI_BUT_DISABLED) == 0) {