From 00087fc9671bb53e7f8384850f6ac46123de4404 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 16 Jun 2005 13:05:29 +0000 Subject: [PATCH] small change git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13178 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/MenuBar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/MenuBar.cpp b/src/kits/interface/MenuBar.cpp index 94e7862ce7..c392150c58 100644 --- a/src/kits/interface/MenuBar.cpp +++ b/src/kits/interface/MenuBar.cpp @@ -411,8 +411,9 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu) if (menuItem != NULL && menuItem != fSelected) { // only select the item SelectItem(menuItem, -1); - if (menuItem->Submenu() != NULL) { - // open the menu + if (menuItem->Submenu() != NULL + && menuItem->Submenu()->Window() == NULL) { + // open the menu if it's not opened yet SelectItem(menuItem); } } @@ -421,15 +422,18 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu) BMenu *menu = fSelected->Submenu(); if (menu != NULL) { window->Unlock(); + if (IsStickyPrefOn()) + menu->SetStickyMode(true); snoozeAmount = 0; resultItem = menu->_track(&localAction); if (window->LockWithTimeout(200000) < B_OK) break; } } - + window->Unlock(); - if (buttons == 0 || localAction == MENU_ACT_CLOSE) + + if (localAction == MENU_ACT_CLOSE) break; if (snoozeAmount > 0)