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
+3 -5
View File
@@ -1116,15 +1116,14 @@ BMenu::_track(int *action, long start)
if (item != NULL) { if (item != NULL) {
if (item != fSelected) if (item != fSelected)
SelectItem(item); SelectItem(item);
}
int submenuAction = MENU_ACT_NONE; int submenuAction = MENU_ACT_NONE;
BMenuItem *submenuItem = NULL; BMenuItem *submenuItem = NULL;
// TODO: Review this as it doesn't work very well, if (fSelected != NULL && fSelected->Submenu() != NULL) {
// BMenu::_track() isn't always called when needed.
if (item->Submenu() != NULL) {
UnlockLooper(); UnlockLooper();
submenuItem = item->Submenu()->_track(&submenuAction); submenuItem = fSelected->Submenu()->_track(&submenuAction);
if (submenuAction == MENU_ACT_CLOSE) { if (submenuAction == MENU_ACT_CLOSE) {
item = submenuItem; item = submenuItem;
localAction = submenuAction; localAction = submenuAction;
@@ -1134,7 +1133,6 @@ BMenu::_track(int *action, long start)
if (!LockLooper()) if (!LockLooper())
break; break;
} }
}
UnlockLooper(); UnlockLooper();
} }