Patch by "stimut": Fixed BMenu to return only enabled BMenuItems when invoking

them via mouse. This will make the mechanism that BSeparatorItems are always
disabled actually work and the behavior correct for other items as well. It also
fixes #4147 (Magnify crashing because it assume all its items have a BMessage).

Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35248 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-01-23 07:50:45 +00:00
parent 148637e9d0
commit abc26ba8ad
1 changed files with 1 additions and 1 deletions

View File

@ -2437,7 +2437,7 @@ BMenu::_HitTestItems(BPoint where, BPoint slop) const
int32 itemCount = CountItems();
for (int32 i = 0; i < itemCount; i++) {
BMenuItem* item = ItemAt(i);
if (item->Frame().Contains(where))
if (item->IsEnabled() && item->Frame().Contains(where))
return item;
}