Author: vfr
Date: Sat Mar 19 20:20:42 2011
New Revision: 37969
URL: http://www.lyx.org/trac/changeset/37969

Log:
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.

Modified:
   lyx-devel/trunk/src/frontends/qt4/GuiView.cpp

Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.cpp       Sat Mar 19 18:54:21 
2011        (r37968)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.cpp       Sat Mar 19 20:20:42 
2011        (r37969)
@@ -1151,7 +1151,9 @@
                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 @@
 {
        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 @@
        connectBuffer(*newBuffer);
        connectBufferView(wa->bufferView());
        setCurrentWorkArea(wa);
-
-       setBusy(false);
 }
 
 
@@ -1865,10 +1866,10 @@
                setBusy(false);
                throw(e);
        }
+       setBusy(false);
 
        if (!newBuffer) {
                message(_("Document not loaded."));
-               setBusy(false);
                return 0;
        }
 
@@ -1878,7 +1879,6 @@
        if (tolastfiles)
                theSession().lastFiles().add(filename);
 
-       setBusy(false);
        return newBuffer;
 }
 

Reply via email to