Clicking on a menu item that already has an open submenu will close the

sub menu and quit menu tracking. This closes #1826. I tested a bit with
various different menu situations and there seem to be no negative side
effects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26561 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-07-22 10:50:34 +00:00
parent dcd20e9d16
commit ea021c679f

View File

@ -549,9 +549,12 @@ BMenuBar::_Track(int32 *action, int32 startIndex, bool showMenu)
buttons = newButtons;
if (buttons != 0 && _IsStickyMode()) {
if (menuItem == NULL)
if (menuItem == NULL
|| (menuItem->Submenu() && menuItem->Submenu()->Window())) {
// clicked outside menu bar or on item with already
// open sub menu
fState = MENU_STATE_CLOSED;
else
} else
_SetStickyMode(false);
} else if (buttons == 0 && !_IsStickyMode()) {
if ((fSelected != NULL && fSelected->Submenu() == NULL)