From 83661da26ae18082cce96789933b4e5fc1c56ddb Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Fri, 14 Mar 2008 23:25:56 +0000 Subject: [PATCH] * When clicking the close button on a background window, it can be that the window does not get the current view when the closeEvent arrives. So better make sure it is the current explicitly. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23734 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 89fa9618ca..c1e05864bc 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -366,6 +366,10 @@ void GuiView::showEvent(QShowEvent * e) 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); + while (Buffer * b = buffer()) { if (b->parent()) { // This is a child document, just close the tab after saving