}
+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_;
+}
+
bool GuiApplication::getStatus(FuncRequest const & cmd, FuncStatus & flag) const
{
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();
}
{
LASSERT(d->views_[gv->id()] == gv, /**/);
d->views_.remove(gv->id());
- if (current_view_ == gv) {
+ if (current_view_ == gv)
current_view_ = 0;
- theLyXFunc().setLyXView(0);
- }
}