diff --git a/src/fmenu.cpp b/src/fmenu.cpp index dadbfd4d..0e5c09b9 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -218,16 +218,9 @@ void FMenu::hideSuperMenus() if ( isMenuBar(super) ) { FMenuBar* mbar = reinterpret_cast(super); - FMenuItem* selectedMenuItem = mbar->getSelectedItem(); - if ( selectedMenuItem ) - { - selectedMenuItem->unsetSelected(); - selectedMenuItem = 0; - mbar->mouse_down = false; - mbar->drop_down = false; - mbar->redraw(); - } + if ( mbar->hasSelectedItem() ) + mbar->leaveMenuBar(); } else if ( isMenu(super) ) { diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index f4deb357..e72b9d80 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -446,6 +446,9 @@ void FMenuBar::adjustSize() void FMenuBar::leaveMenuBar() { resetMenu(); + if ( hasSelectedItem() ) + getSelectedItem()->unsetSelected(); + setSelectedItem(0); redraw(); activatePrevWindow(); getActiveWindow()->getFocusWidget()->setFocus(); @@ -454,7 +457,7 @@ void FMenuBar::leaveMenuBar() statusBar()->drawMessage(); updateTerminal(); flush_out(); - drop_down = false; + mouse_down = false; } // public methods of FMenuBar