]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Fix crash noticed by Bennett:
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index 982d16a7b5a0dbf726c179f1ee9335da37f9e82a..6b0a78adaaa693a76bc20c5eda488552de9cd68b 100644 (file)
@@ -800,7 +800,7 @@ docstring GuiApplication::iconName(FuncRequest const & f, bool unknown)
 }
 
 
-LyXView * GuiApplication::currentWindow()
+LyXView * GuiApplication::currentWindow() 
 {
 #ifdef Q_WS_MACX
        /* In LyX/Mac, when a dialog is open, the menus of the
@@ -808,7 +808,7 @@ LyXView * GuiApplication::currentWindow()
           the main window. In this case, we want to disable the menu
           entries that are buffer or view-related.
        */
-       if (current_view_ && current_view_->activeWindow() != this)
+       if (current_view_ && activeWindow() != current_view_)
                return 0;
 #endif
        return current_view_;
@@ -1026,6 +1026,7 @@ void GuiApplication::resetGui()
        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();
        }