]> git.lyx.org Git - features.git/commitdiff
Fixed #6335.
authorTommaso Cucinotta <tommaso@lyx.org>
Sun, 10 Jan 2010 19:08:41 +0000 (19:08 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Sun, 10 Jan 2010 19:08:41 +0000 (19:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32949 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index e39719f3f63be86a2a9b089c1bc14225bc34c495..852aabe510678590de98f473d2d722832e89a20b 100644 (file)
@@ -585,11 +585,20 @@ TocModels & GuiView::tocModels()
 void GuiView::setFocus()
 {
        LYXERR(Debug::DEBUG, "GuiView::setFocus()" << this);
+       QMainWindow::setFocus();
+}
+
+
+void GuiView::focusInEvent(QFocusEvent * e)
+{
+       LYXERR(Debug::DEBUG, "GuiView::focusInEvent()" << this);
+       QMainWindow::focusInEvent(e);
        // Make sure LyXFunc points to the correct view.
        guiApp->setCurrentView(this);
-       QMainWindow::setFocus();
-       if (d.current_work_area_)
-               d.current_work_area_->setFocus();
+       if (currentMainWorkArea())
+               currentMainWorkArea()->setFocus();
+       else if (currentWorkArea())
+               currentWorkArea()->setFocus();
        else
                d.bg_widget_->setFocus();
 }