Revert "MenuBar: Fix sticky menu issue. #6408 comment:9"

This reverts commit 7462734202.

Fixes #10072, breaks #6408 comment:9 again.
This commit is contained in:
John Scipione
2013-10-08 13:29:56 -04:00
parent c09cf60cc2
commit e67f9c9bd1
+3 -6
View File
@@ -571,9 +571,8 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu)
// where to store the current mouse position ? // where to store the current mouse position ?
// (Or just use the BView mouse hooks) // (Or just use the BView mouse hooks)
BPoint newWhere; BPoint newWhere;
uint32 newButtons;
if (LockLooper()) { if (LockLooper()) {
GetMouse(&newWhere, &newButtons); GetMouse(&newWhere, &buttons);
UnlockLooper(); UnlockLooper();
} }
@@ -631,9 +630,7 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu)
} while (newWhere == where && newButtons == buttons } while (newWhere == where && newButtons == buttons
&& fState == MENU_STATE_TRACKING); && fState == MENU_STATE_TRACKING);
uint32 test = newWhere == where ? 0 : buttons; if (newButtons != 0 && _IsStickyMode()) {
if (newButtons != test && _IsStickyMode()) {
if (item == NULL || (item->Submenu() != NULL if (item == NULL || (item->Submenu() != NULL
&& item->Submenu()->Window() != NULL)) { && item->Submenu()->Window() != NULL)) {
// clicked outside the menu bar or on item with already // 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; fState = MENU_STATE_CLOSED;
} else } else
_SetStickyMode(false); _SetStickyMode(false);
} else if (newButtons == test && !_IsStickyMode()) { } else if (newButtons == 0 && !_IsStickyMode()) {
if ((fSelected != NULL && fSelected->Submenu() == NULL) if ((fSelected != NULL && fSelected->Submenu() == NULL)
|| item == NULL) { || item == NULL) {
// clicked on an item without a submenu or clicked and // clicked on an item without a submenu or clicked and