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
This commit is contained in:
Abdelrazak Younes 2008-10-03 07:54:32 +00:00
parent d8a6c1fc1e
commit 4ea899a7af
2 changed files with 3 additions and 5 deletions

View File

@ -968,7 +968,6 @@ void GuiApplication::createView(QString const & geometry_arg, bool autoShow,
#endif
}
view->setFocus();
setCurrentView(view);
}

View File

@ -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()) {