From 85c30aeccb4d4c0ac11c5bf46ff41ed48e5ec630 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 3 Nov 2011 16:10:21 +0000 Subject: [PATCH] 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 --- src/kits/interface/Window.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index b95e19d313..27987968b6 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1187,16 +1187,6 @@ FrameMoved(origin); { BView* view = dynamic_cast(target); - // Close an eventually opened menu - // unless the target is the menu itself - BMenu* menu = dynamic_cast(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;