diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 6606ec195e..c32a5e400e 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -746,7 +746,7 @@ bool GuiApplication::searchMenu(FuncRequest const & func, void GuiApplication::initGlobalMenu() { if (global_menubar_) - menus().fillMenuBar(global_menubar_, 0); + menus().fillMenuBar(global_menubar_, 0, true); } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 51964929fa..40423df3d3 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -283,7 +283,7 @@ GuiView::GuiView(int id) theLyXFunc().setLyXView(this); // Fill up the menu bar. - guiApp->menus().fillMenuBar(menuBar(), this); + guiApp->menus().fillMenuBar(menuBar(), this, true); setCentralWidget(d.stack_widget_); diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 3cb90fa0cb..bbb03d8350 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -1461,15 +1461,17 @@ bool Menus::searchMenu(FuncRequest const & func, } -void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view) +void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial) { - // Clear all menubar contents before filling it. - qmb->clear(); - + if (initial) { #ifdef Q_WS_MACX - // setup special mac specific menu item - d->macxMenuBarInit(view, qmb); + // setup special mac specific menu item + d->macxMenuBarInit(view, qmb); #endif + } else { + // Clear all menubar contents before filling it. + qmb->clear(); + } LYXERR(Debug::GUI, "populating menu bar" << fromqstr(d->menubar_.name())); diff --git a/src/frontends/qt4/Menus.h b/src/frontends/qt4/Menus.h index d0bc687591..f0b0789e20 100644 --- a/src/frontends/qt4/Menus.h +++ b/src/frontends/qt4/Menus.h @@ -64,7 +64,7 @@ public: bool searchMenu(FuncRequest const & func, std::vector & names) const; /// - void fillMenuBar(QMenuBar * qmb, GuiView * view); + void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false); /// \return a top-level submenu given its name. Menu * menu(QString const & name, GuiView & view);