From 27e7210df2e4cebc78fb46935dfa5e88d9ff5208 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 5 Jan 2007 10:03:33 +0000 Subject: [PATCH] Since Waldemar changes to menus, replicants menus didn't work anymore. That problem showed up for example during my haiku presentation at Begeistert, where I couldn't delete replicants from the desktop... grrrr!!! :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19708 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 06c32c32e1..59ad45666b 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1064,11 +1064,8 @@ BMenu::Track(bool sticky, BRect *clickToOpenRect) UnlockLooper(); } - // If sticky is false, pass 0 to the tracking function - // so the menu will stay in nonsticky mode - const bigtime_t trackTime = sticky ? system_time() : 0; int action; - BMenuItem *menuItem = _track(&action, trackTime); + BMenuItem *menuItem = _track(&action, 0); SetStickyMode(false); fExtraRect = NULL; @@ -1398,14 +1395,11 @@ BMenu::_UpdateStateClose(BMenuItem *item, const BPoint &where, const uint32 &but SetStickyMode(false); } } else if (buttons == 0 && !IsStickyMode()) { -/* TODO: FIXME! trackTime is a hacky workaround for BMenuField. It - opens directly under your mouse pointer, so when you release the mouse - button the menu closes again because it started in non-sticky mode. */ -/* if (system_time() < trackTime + 1000000 - || (fExtraRect != NULL && fExtraRect->Contains(location))) */ - if (fExtraRect != NULL && fExtraRect->Contains(where)) + if (fExtraRect != NULL && fExtraRect->Contains(where)) { SetStickyMode(true); - else + fExtraRect = NULL; + // This code should be executed only once + } else fState = MENU_STATE_CLOSED; } }