From abc26ba8ad02a8394a30dece78ba443fc099b81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 23 Jan 2010 07:50:45 +0000 Subject: [PATCH] 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 --- src/kits/interface/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 4c47e75ebd..ed08ffc9ec 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -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; }