]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Skip paint event when in the middle of a buffer operation
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index c65d39ec17bb30d6a3ac0d243332cd2af52e9848..93eb2e86ecded8a82771a7f6b02aa3dc585464d8 100644 (file)
@@ -1396,16 +1396,18 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
                current_view_->currentBufferView()->cursor().saveBeforeDispatchPosXY();
                buffer = &current_view_->currentBufferView()->buffer();
        }
-       // This handles undo groups automagically
-       UndoGroupHelper ugh(buffer);
 
        DispatchResult dr;
+       dr.screenUpdate(Update::FitCursor);
+       {
+               // This handles undo groups automagically
+               UndoGroupHelper ugh(buffer);
+               dispatch(cmd, dr);
+       }
+
        // redraw the screen at the end (first of the two drawing steps).
        // This is done unless explicitly requested otherwise
-       dr.screenUpdate(Update::FitCursor);
-       dispatch(cmd, dr);
        updateCurrentView(cmd, dr);
-
        d->dispatch_result_ = dr;
        return d->dispatch_result_;
 }