PopUpMenus didn't respect the openanyway setting (sticky mode), they always set it. And even in that case, they weren't working correctly. This should fix bugs 463 and 476. This might not work if click to open isn't selected in the menu prefs, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17136 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -959,14 +959,9 @@ BMenu::Hide()
|
||||
|
||||
|
||||
BMenuItem *
|
||||
BMenu::Track(bool openAnyway, BRect *clickToOpenRect)
|
||||
{
|
||||
if (!IsStickyPrefOn())
|
||||
openAnyway = false;
|
||||
|
||||
SetStickyMode(openAnyway);
|
||||
|
||||
if (openAnyway && LockLooper()) {
|
||||
BMenu::Track(bool sticky, BRect *clickToOpenRect)
|
||||
{
|
||||
if (sticky && LockLooper()) {
|
||||
RedrawAfterSticky(Bounds());
|
||||
UnlockLooper();
|
||||
}
|
||||
@@ -977,8 +972,12 @@ BMenu::Track(bool openAnyway, BRect *clickToOpenRect)
|
||||
UnlockLooper();
|
||||
}
|
||||
|
||||
// If sticky is false, pass 0 to the tracking function
|
||||
// so the menu will stay in nonsticky mode, regardless
|
||||
// of the "IsStickyPrefOn()" value
|
||||
const bigtime_t trackTime = sticky ? system_time() : 0;
|
||||
int action;
|
||||
BMenuItem *menuItem = _track(&action, system_time());
|
||||
BMenuItem *menuItem = _track(&action, trackTime);
|
||||
|
||||
SetStickyMode(false);
|
||||
fExtraRect = NULL;
|
||||
|
||||
Reference in New Issue
Block a user