From 19263a634b442d3d8544a34a2794f57cec8dd499 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 19 Mar 2011 19:20:42 +0000 Subject: [PATCH] Fix bug #7314: Workareas not redrawn. This is caused because the current_workarea doesn't get updated anymore while LyX is busy. However, when LyX stops being busy, the current workarea might have changed, and we are missing out on an update. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37969 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 01a4cb5749..0832aea5f5 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1151,7 +1151,9 @@ void GuiView::setBusy(bool busy) return; if (d.current_work_area_) { - d.current_work_area_->setUpdatesEnabled(!busy); + //Why would we want to stop updates only for one workarea and + //not for the others ? This leads to problems as in #7314 (vfr). + //d.current_work_area_->setUpdatesEnabled(!busy); if (busy) d.current_work_area_->stopBlinkingCursor(); else @@ -1369,11 +1371,12 @@ void GuiView::setBuffer(Buffer * newBuffer) { LYXERR(Debug::DEBUG, "Setting buffer: " << newBuffer << endl); LASSERT(newBuffer, return); - setBusy(true); - + GuiWorkArea * wa = workArea(*newBuffer); if (wa == 0) { + setBusy(true); newBuffer->masterBuffer()->updateBuffer(); + setBusy(false); wa = addWorkArea(*newBuffer); // scroll to the position when the BufferView was last closed if (lyxrc.use_lastfilepos) { @@ -1388,8 +1391,6 @@ void GuiView::setBuffer(Buffer * newBuffer) connectBuffer(*newBuffer); connectBufferView(wa->bufferView()); setCurrentWorkArea(wa); - - setBusy(false); } @@ -1865,10 +1866,10 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles) setBusy(false); throw(e); } + setBusy(false); if (!newBuffer) { message(_("Document not loaded.")); - setBusy(false); return 0; } @@ -1878,7 +1879,6 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles) if (tolastfiles) theSession().lastFiles().add(filename); - setBusy(false); return newBuffer; } -- 2.39.2