Don't quit tracking the menu even if OverSuper() returns true, if HitTestItems() doesn't return NULL. This should fix (at least in part) bug #85
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15891 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6c678c57c7
commit
b120bcd665
@ -1070,29 +1070,30 @@ BMenu::_hide()
|
||||
BMenuItem *
|
||||
BMenu::_track(int *action, long start)
|
||||
{
|
||||
// TODO: Take Sticky mode into account
|
||||
BPoint location;
|
||||
// TODO: Take Sticky mode into account, cleanup
|
||||
ulong buttons;
|
||||
BMenuItem *item = NULL;
|
||||
int localAction = MENU_ACT_NONE;
|
||||
do {
|
||||
if (!LockLooper())
|
||||
break;
|
||||
|
||||
|
||||
BPoint location;
|
||||
GetMouse(&location, &buttons);
|
||||
if (OverSuper(location)) {
|
||||
UnlockLooper();
|
||||
break;
|
||||
}
|
||||
|
||||
item = HitTestItems(location, B_ORIGIN);
|
||||
|
||||
if (item != NULL) {
|
||||
if (item != fSelected)
|
||||
SelectItem(item);
|
||||
} else if (fSelected != NULL && !OverSubmenu(fSelected, ConvertToScreen(location)))
|
||||
} else {
|
||||
if (OverSuper(location)) {
|
||||
UnlockLooper();
|
||||
break;
|
||||
}
|
||||
if (fSelected != NULL && !OverSubmenu(fSelected, ConvertToScreen(location)))
|
||||
SelectItem(NULL);
|
||||
|
||||
}
|
||||
|
||||
if (fSelected != NULL && fSelected->Submenu() != NULL) {
|
||||
UnlockLooper();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user