- Fixed the recently introduced bug where menus would open again once closed. -Now hitting ESC will close the menu. - Reverted to the other variation of GetMouse() as Axel's advice
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17654 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -400,8 +400,8 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
|
||||
BPoint where;
|
||||
ulong buttons;
|
||||
GetMouse(&where, &buttons, false);
|
||||
// Get the current mouse state
|
||||
GetMouse(&where, &buttons, true);
|
||||
|
||||
window->UpdateIfNeeded();
|
||||
BMenuItem *menuItem = HitTestItems(where, B_ORIGIN);
|
||||
if (menuItem != NULL) {
|
||||
@@ -450,7 +450,10 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
|
||||
if (locked)
|
||||
window->Unlock();
|
||||
|
||||
|
||||
if (fState == MENU_STATE_CLOSED)
|
||||
break;
|
||||
|
||||
if (localAction == MENU_STATE_CLOSED || (buttons != 0 && IsStickyMode() && menuItem == NULL))
|
||||
break;
|
||||
else if (buttons == 0 && !IsStickyMode()) {
|
||||
@@ -462,9 +465,6 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
SetStickyMode(true);
|
||||
}
|
||||
|
||||
if (fState == MENU_STATE_CLOSED)
|
||||
break;
|
||||
|
||||
if (snoozeAmount > 0)
|
||||
snooze(snoozeAmount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user