Fixed menu disappearing bug when (in sticky mode) mouse button is pressed (and held down) and the mouse pointer is moved outside of the menu. Now, menus should work as expected and switch from sticky to non-sticky mode on mouse button press correctly.
BTW, I disabled trackTime. It seems to work without it, correctly, so I guess it can be removed completely.
If not, just revert the change ("if (system_time....") after TODO.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19358 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -466,10 +466,17 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
window->Unlock();
|
||||
locked = false;
|
||||
snoozeAmount = 30000;
|
||||
if (IsStickyMode())
|
||||
bool wasSticky = IsStickyMode();
|
||||
if (wasSticky)
|
||||
menu->SetStickyMode(true);
|
||||
int localAction;
|
||||
fChosenItem = menu->_track(&localAction, system_time());
|
||||
|
||||
// check if the user started holding down a mouse button in a submenu
|
||||
if (wasSticky && !IsStickyMode())
|
||||
buttons = 1;
|
||||
// buttons must have been pressed in the meantime
|
||||
|
||||
//menu->Window()->Activate();
|
||||
if (localAction == MENU_STATE_CLOSED)
|
||||
fState = MENU_STATE_CLOSED;
|
||||
|
||||
Reference in New Issue
Block a user