[haiku-commits] r43166 - haiku/trunk/src/kits/interface

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 3 Nov 2011 17:10:22 +0100 (CET)

Author: anevilyak
Date: 2011-11-03 17:10:21 +0100 (Thu, 03 Nov 2011)
New Revision: 43166
Changeset: https://dev.haiku-os.org/changeset/43166

Modified:
   haiku/trunk/src/kits/interface/Window.cpp
Log:
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.



Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp   2011-11-03 14:27:39 UTC (rev 
43165)
+++ haiku/trunk/src/kits/interface/Window.cpp   2011-11-03 16:10:21 UTC (rev 
43166)
@@ -1187,16 +1187,6 @@
                {
                        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 @@
 {
        BRect decoratorFrame(Frame());
        BRect tabRect(0, 0, 0, 0);
-       
+
        float borderWidth = 5.0;
 
        BMessage settings;
@@ -2106,7 +2096,7 @@
                decoratorFrame.right += borderWidth;
                decoratorFrame.bottom += borderWidth;
        }
-       
+
        return decoratorFrame;
 }
 
@@ -3065,6 +3055,9 @@
                                                        
DispatchMessage(fLastMessage, handler);
                                        }
 
+                                       if (!cookie.tokens_scanned)
+                                               continue;
+
                                        // Delete the current message
                                        delete fLastMessage;
                                        fLastMessage = NULL;


Other related posts: