Skip to content

Commit

Permalink
Revert "Took out the fix for #4527 again, this is handled in the TopL…
Browse files Browse the repository at this point in the history
…evelFrame class now"

We seem to need it after all.

This reverts commit 17174ac.
  • Loading branch information
codereader committed Jul 18, 2017
1 parent 9c1e6bb commit b80c162
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/uimanager/menu/MenuManager.cpp
Expand Up @@ -184,6 +184,23 @@ void MenuManager::handleElementAdded(const MenuElementPtr& element)
parentMenu->setNeedsRefresh(true);
}

#ifdef __linux__
// In Linux, we don't receive the wxEVT_MENU_OPEN event on the MenuFolder
// Option 1 is to add the event handler to the wxFrame housing the wxMenuBar
// but we don't always know what wxFrame that is (it's added later)
// Option 2 is to mark the whole menu as "needs refresh" => let's go with this
while (parentMenu)
{
if (std::dynamic_pointer_cast<MenuBar>(parentMenu))
{
std::static_pointer_cast<MenuBar>(parentMenu)->setNeedsRefresh(true);
break;
}

parentMenu = parentMenu->getParent();
}
#endif

// When inserting a new menu in a menubar, make sure it is constructed
if (element->getParent() &&
std::dynamic_pointer_cast<MenuBar>(element->getParent()) &&
Expand Down

0 comments on commit b80c162

Please sign in to comment.