Remove extraneous code with respect to telling a menu to close which was

breaking various cases where menus coexisted in a window with a view which
was using event masks:
	- If one invoked the menu via, e.g. a BMenuField, and then tried to choose
	  an item on it, the mouse down would get captured, the menu would be
	  closed, and the mouse event would be thrown away without ever reaching
	  the event mask view.

	 - Furthermore, since the menu was told to terminate early, it would decide
	   that the user hadn't actually chosen that item (the escape key case),
	   and never actually invoke it.

Fixes the menu fields in the mouse preflet being broken.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43166 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2011-11-03 16:10:21 +00:00
parent bd291de302
commit 85c30aeccb
+5 -12
View File
@@ -1187,16 +1187,6 @@ FrameMoved(origin);
{
BView* view = dynamic_cast<BView*>(target);
// Close an eventually opened menu
// unless the target is the menu itself
BMenu* menu = dynamic_cast<BMenu*>(fFocus);
MenuPrivate privMenu(menu);
if (menu != NULL && menu != view
&& privMenu.State() != MENU_STATE_CLOSED) {
privMenu.QuitTracking();
return;
}
if (view != NULL) {
BPoint where;
msg->FindPoint("be:view_where", &where);
@@ -2079,7 +2069,7 @@ BWindow::DecoratorFrame() const
{
BRect decoratorFrame(Frame());
BRect tabRect(0, 0, 0, 0);
float borderWidth = 5.0;
BMessage settings;
@@ -2106,7 +2096,7 @@ BWindow::DecoratorFrame() const
decoratorFrame.right += borderWidth;
decoratorFrame.bottom += borderWidth;
}
return decoratorFrame;
}
@@ -3065,6 +3055,9 @@ BWindow::task_looper()
DispatchMessage(fLastMessage, handler);
}
if (!cookie.tokens_scanned)
continue;
// Delete the current message
delete fLastMessage;
fLastMessage = NULL;