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>2013-06-19 10:01:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-19 10:01:38 +0400
commit93134c26f97d6fb8fe49af4d9cb043a97b7da746 (patch)
tree1b03de75795d0fbc3c0d84ca36bc3fa664545382 /source/blender
parent841c200767bbc84afa6d1ce186dabe234fc0aaf5 (diff)
fix [#35792] Submenus not opening properly on mouse move
caused by own fix for [#35346], now only apply wiggle room for toplevel menus.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_handlers.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index a9378d11cc3..ca8131348d7 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6581,7 +6581,8 @@ static void ui_mouse_motion_towards_reinit(uiPopupBlockHandle *menu, const int x
ui_mouse_motion_towards_init_ex(menu, xy, true);
}
-static bool ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *menu, const int xy[2])
+static bool ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *menu, const int xy[2],
+ const bool use_wiggle_room)
{
float p1[2], p2[2], p3[2], p4[2];
float oldp[2] = {menu->towards_xy[0], menu->towards_xy[1]};
@@ -6615,8 +6616,8 @@ static bool ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *me
p4[1] = rect_px.ymax + margin;
/* allow for some wiggle room, if the user moves a few pixels away,
- * don't immediately quit */
- {
+ * don't immediately quit (only for top level menus) */
+ if (use_wiggle_room) {
const float cent[2] = {
BLI_rctf_cent_x(&rect_px),
BLI_rctf_cent_y(&rect_px)};
@@ -7130,7 +7131,7 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
menu->menuretval = UI_RETURN_CANCEL | UI_RETURN_POPUP_OK;
}
else {
- ui_mouse_motion_towards_check(block, menu, &event->x);
+ ui_mouse_motion_towards_check(block, menu, &event->x, (level == 0));
/* check mouse moving outside of the menu */
if (inside == 0 && (block->flag & UI_BLOCK_MOVEMOUSE_QUIT)) {