Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-27 09:49:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-27 11:45:20 +0300
commit756b9acaf552bb82596f2239f522467372e4e661 (patch)
treef6cc098db98264ab3bbb01d2125055fd11262553 /source/blender/editors/interface/interface_handlers.c
parent3ca9eaf187051477e8fb0219f014f278cc1178a3 (diff)
Fix T71719: Unrelated menus open on hover
Logic to open menus on hover changed since 2.7x for convenience switching between popovers in the top-bar. This also made hover open menus in situations where it isn't useful. Restrict this to buttons placed side-by-side.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 05d5f03a363..089c87b86ed 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -10614,7 +10614,13 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE
(ui_screen_region_find_mouse_over(screen, event) == NULL) &&
(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, UI_BTYPE_MENU))) {
+ (ELEM(but_other->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU)) &&
+ /* Hover-opening menu's doesn't work well for buttons over one another
+ * along the same axis the menu is opening on (see T71719). */
+ (((data->menu->direction & (UI_DIR_LEFT | UI_DIR_RIGHT)) &&
+ BLI_rctf_isect_rect_x(&but->rect, &but_other->rect, NULL)) ||
+ ((data->menu->direction & (UI_DIR_DOWN | UI_DIR_UP)) &&
+ BLI_rctf_isect_rect_y(&but->rect, &but_other->rect, NULL)))) {
/* 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) {