diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-15 16:54:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-15 17:00:40 +0300 |
commit | b262fba5e379b8f9d04af850e30e3e431db2b8c4 (patch) | |
tree | 7331b158241a091b7e53749df28b66253a4f9ec3 /source/blender/editors/interface | |
parent | 1d067868c05cc3b8b8b76f6d21ef4a3eebdc885c (diff) |
Fix T55587: bugs with popovers in collapsed menus, like the timeline header.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 15 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_region_popover.c | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ac7ed3d5106..0ba9261c4bd 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8228,7 +8228,7 @@ static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, u static void ui_mouse_motion_towards_init_ex(uiPopupBlockHandle *menu, const int xy[2], const bool force) { - BLI_assert(((uiBlock *)menu->region->uiblocks.first)->flag & UI_BLOCK_MOVEMOUSE_QUIT); + BLI_assert(((uiBlock *)menu->region->uiblocks.first)->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)); if (!menu->dotowards || force) { menu->dotowards = true; @@ -8263,7 +8263,7 @@ static bool ui_mouse_motion_towards_check( const float margin = MENU_TOWARDS_MARGIN; rctf rect_px; - BLI_assert(block->flag & UI_BLOCK_MOVEMOUSE_QUIT); + BLI_assert(block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)); /* annoying fix for [#36269], this is a bit odd but in fact works quite well @@ -8579,7 +8579,7 @@ static int ui_handle_menu_event( #endif if (but && button_modal_state(but->active->state)) { - if (block->flag & UI_BLOCK_MOVEMOUSE_QUIT) { + if (block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)) { /* if a button is activated modal, always reset the start mouse * position of the towards mechanism to avoid loosing focus, * and don't handle events */ @@ -8593,7 +8593,7 @@ static int ui_handle_menu_event( else { /* for ui_mouse_motion_towards_block */ if (event->type == MOUSEMOVE) { - if (block->flag & UI_BLOCK_MOVEMOUSE_QUIT) { + if (block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)) { ui_mouse_motion_towards_init(menu, &event->x); } @@ -8910,7 +8910,8 @@ static int ui_handle_menu_event( else { /* check mouse moving outside of the menu */ - if (inside == 0 && (block->flag & UI_BLOCK_MOVEMOUSE_QUIT)) { + //printf("inside %d mm quit %d\n", inside, block->flag & (UI_BLOCK_MOVEMOUSE_QUIT); + if (inside == 0 && (block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER))) { uiSafetyRct *saferct; ui_mouse_motion_towards_check(block, menu, &event->x, is_parent_inside == false); @@ -9019,7 +9020,7 @@ static int ui_handle_menu_return_submenu(bContext *C, const wmEvent *event, uiPo submenu->menuretval = 0; } - if (block->flag & UI_BLOCK_MOVEMOUSE_QUIT) { + if (block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)) { /* for cases where close does not cascade, allow the user to * move the mouse back towards the menu without closing */ ui_mouse_motion_towards_reinit(menu, &event->x); @@ -9419,7 +9420,7 @@ static int ui_handle_menus_recursive( retval = ui_handle_menu_button(C, event, menu); - if (block->flag & UI_BLOCK_MOVEMOUSE_QUIT) { + if (block->flag & (UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_POPOVER)) { /* when there is a active search button and we close it, * we need to reinit the mouse coords [#35346] */ if (ui_but_find_active_in_region(menu->region) != but) { diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c index 376e367f4da..56ec61c5226 100644 --- a/source/blender/editors/interface/interface_region_popover.c +++ b/source/blender/editors/interface/interface_region_popover.c @@ -155,7 +155,7 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v UI_block_bounds_set_normal(block, block_margin); /* If menu slides out of other menu, override direction. */ - bool slideout = false; //ui_block_is_menu(pup->but->block); + bool slideout = ui_block_is_menu(pup->but->block); if (slideout) UI_block_direction_set(block, UI_DIR_RIGHT); |