From 4ea899a7af5d2e947ce854b7469d5663ad8b9a3e Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 3 Oct 2008 07:54:32 +0000 Subject: [PATCH] Make sure that the focus is correctly set before closing a window. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26690 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 1 - src/frontends/qt4/GuiView.cpp | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index b6d96eca6d..3a3f11bce4 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -968,7 +968,6 @@ void GuiApplication::createView(QString const & geometry_arg, bool autoShow, #endif } view->setFocus(); - setCurrentView(view); } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 09880cec32..5bcd6aae7b 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -483,11 +483,11 @@ TocModels & GuiView::tocModels() void GuiView::setFocus() { // Make sure LyXFunc points to the correct view. + guiApp->setCurrentView(this); theLyXFunc().setLyXView(this); + QMainWindow::setFocus(); if (d.current_work_area_) d.current_work_area_->setFocus(); - else - QWidget::setFocus(); } @@ -517,8 +517,7 @@ void GuiView::closeEvent(QCloseEvent * close_event) // it can happen that this event arrives without selecting the view, // e.g. when clicking the close button on a background window. - theLyXFunc().setLyXView(this); - guiApp->setCurrentView(this); + setFocus(); while (Buffer * b = buffer()) { if (b->parent()) { -- 2.39.2