From cc116483efd690810eef9795c48e8ff69e662e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 15 Aug 2007 02:12:05 +0000 Subject: [PATCH] The bug worked around in r21960 also affected Haiku. Now, a menu is only quit if the click into its "controlling" window targeted the preferred handler - ie. is a standard click that is not sent because of an event mask. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21961 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 840bbe7c50..4d3a05def7 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1008,9 +1008,11 @@ FrameMoved(origin); { BView *view = dynamic_cast(target); - // Close an eventually opened menu, unless the target is the menu itself + // Close an eventually opened menu, if this click targets the + // preferred handler, and unless the target is the menu itself BMenu *menu = dynamic_cast(fFocus); - if (menu != NULL && menu != view && menu->State() != MENU_STATE_CLOSED) { + if (menu != NULL && menu != view && PreferredHandler() == target + && menu->State() != MENU_STATE_CLOSED) { menu->QuitTracking(); return; }