From e67f9c9bd11e8dc9087fc0f91090609a6b1776e2 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 8 Oct 2013 13:29:56 -0400 Subject: [PATCH] Revert "MenuBar: Fix sticky menu issue. #6408 comment:9" This reverts commit 74627342028d4a2ca7cf4e64d5ea9a07efab87ef. Fixes #10072, breaks #6408 comment:9 again. --- src/kits/interface/MenuBar.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/MenuBar.cpp b/src/kits/interface/MenuBar.cpp index 185e2ac599..139123e5cd 100644 --- a/src/kits/interface/MenuBar.cpp +++ b/src/kits/interface/MenuBar.cpp @@ -571,9 +571,8 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu) // where to store the current mouse position ? // (Or just use the BView mouse hooks) BPoint newWhere; - uint32 newButtons; if (LockLooper()) { - GetMouse(&newWhere, &newButtons); + GetMouse(&newWhere, &buttons); UnlockLooper(); } @@ -631,9 +630,7 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu) } while (newWhere == where && newButtons == buttons && fState == MENU_STATE_TRACKING); - uint32 test = newWhere == where ? 0 : buttons; - - if (newButtons != test && _IsStickyMode()) { + if (newButtons != 0 && _IsStickyMode()) { if (item == NULL || (item->Submenu() != NULL && item->Submenu()->Window() != NULL)) { // clicked outside the menu bar or on item with already @@ -641,7 +638,7 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu) fState = MENU_STATE_CLOSED; } else _SetStickyMode(false); - } else if (newButtons == test && !_IsStickyMode()) { + } else if (newButtons == 0 && !_IsStickyMode()) { if ((fSelected != NULL && fSelected->Submenu() == NULL) || item == NULL) { // clicked on an item without a submenu or clicked and