Fixed submenus for good

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13151 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-06-15 12:09:40 +00:00
parent 757ce6e540
commit ba61835820

View File

@ -1116,24 +1116,22 @@ BMenu::_track(int *action, long start)
if (item != NULL) {
if (item != fSelected)
SelectItem(item);
}
int submenuAction = MENU_ACT_NONE;
BMenuItem *submenuItem = NULL;
if (fSelected != NULL && fSelected->Submenu() != NULL) {
UnlockLooper();
int submenuAction = MENU_ACT_NONE;
BMenuItem *submenuItem = NULL;
// TODO: Review this as it doesn't work very well,
// BMenu::_track() isn't always called when needed.
if (item->Submenu() != NULL) {
UnlockLooper();
submenuItem = item->Submenu()->_track(&submenuAction);
if (submenuAction == MENU_ACT_CLOSE) {
item = submenuItem;
localAction = submenuAction;
break;
}
if (!LockLooper())
break;
submenuItem = fSelected->Submenu()->_track(&submenuAction);
if (submenuAction == MENU_ACT_CLOSE) {
item = submenuItem;
localAction = submenuAction;
break;
}
if (!LockLooper())
break;
}
UnlockLooper();