}
-LyXView * GuiApplication::currentWindow()
+LyXView * GuiApplication::currentWindow()
{
+#ifdef Q_WS_MACX
+ /* In LyX/Mac, when a dialog is open, the menus of the
+ application can still be accessed without giving focus to
+ the main window. In this case, we want to disable the menu
+ entries that are buffer or view-related.
+ */
+ if (current_view_ && activeWindow() != current_view_)
+ return 0;
+#endif
return current_view_;
}
QHash<int, GuiView *>::iterator it;
for (it = d->views_.begin(); it != d->views_.end(); ++it) {
GuiView * gv = *it;
+ setCurrentView(gv);
gv->setLayoutDirection(layoutDirection());
gv->resetDialogs();
}