From 8ad113c30aa1f2110325ba6667c8c92e8c97e74d Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 19 Aug 2007 10:48:16 +0000 Subject: [PATCH] Fix bug 4123: http://bugzilla.lyx.org/show_bug.cgi?id=4123 * GuiView: - closeEvent(): set quitting=true only when quitting. I don't know why and how this was changed but it was clearly wrong. - update_view_state_qt(): only update when focus is in. Make sure this is the current LyXView. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19643 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 7c2c2f14f6..dfb14ac1c8 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -303,13 +303,14 @@ void GuiView::closeEvent(QCloseEvent * close_event) theApp()->gui().unregisterView(id()); if (!theApp()->gui().viewIds().empty()) { - quitting = true; // Just close the window and do nothing else if this is not the // last window. close_event->accept(); return; } + quitting = true; + if (view()->buffer()) { // save cursor position for opened files to .lyx/session // only bottom (whole doc) level pit and pos is saved. @@ -601,6 +602,9 @@ void GuiView::focus_command_widget() void GuiView::update_view_state_qt() { + if (!hasFocus()) + return; + theLyXFunc().setLyXView(this); statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage())); statusbar_timer_.stop(); }