Avoid calling BMenu::HitTestItems() if the cursor is over a submenu.

This commit is contained in:
JackBurton
2012-03-31 13:30:21 +02:00
parent 0efb8b6639
commit 577265d14f
+3 -4
View File
@@ -1629,9 +1629,8 @@ BMenu::_Track(int* action, long start)
// first we check if mouse is inside a submenu, // first we check if mouse is inside a submenu,
// then if the mouse is inside this menu, // then if the mouse is inside this menu,
// then if it's over a super menu. // then if it's over a super menu.
bool overSub = _OverSubmenu(fSelected, screenLocation); if (_OverSubmenu(fSelected, screenLocation)
item = _HitTestItems(location, B_ORIGIN); || fState == MENU_STATE_KEY_TO_SUBMENU) {
if (overSub || fState == MENU_STATE_KEY_TO_SUBMENU) {
if (fState == MENU_STATE_TRACKING) { if (fState == MENU_STATE_TRACKING) {
// not if from R.Arrow // not if from R.Arrow
fState = MENU_STATE_TRACKING_SUBMENU; fState = MENU_STATE_TRACKING_SUBMENU;
@@ -1671,7 +1670,7 @@ BMenu::_Track(int* action, long start)
fState = MENU_STATE_TRACKING; fState = MENU_STATE_TRACKING;
if (!LockLooper()) if (!LockLooper())
break; break;
} else if (item != NULL) { } else if ((item = _HitTestItems(location, B_ORIGIN)) != NULL) {
_UpdateStateOpenSelect(item, location, navAreaRectAbove, _UpdateStateOpenSelect(item, location, navAreaRectAbove,
navAreaRectBelow, selectedTime, navigationAreaTime); navAreaRectBelow, selectedTime, navigationAreaTime);
if (!releasedOnce) if (!releasedOnce)