]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
revert previous commit, it did not compile of course...
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index 641431a91fe2c48b2e593e8e65d028250aedffd5..4656e63a69f5855ce8593e043a099075055a19ab 100644 (file)
@@ -1617,6 +1617,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                BufferView * bv = current_view_->currentBufferView();
                LASSERT(bv, /**/);
        
+               // Avoid a screen redraw in the middle of a dispatch operation just
+               // because a warning or an error was displayed.
+               current_view_->setBusy(true);
+
                // Let the current BufferView dispatch its own actions.
                bv->dispatch(cmd, dr);
                if (dr.dispatched())
@@ -1647,11 +1651,16 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                bv->cursor().dispatch(cmd);
        
                // notify insets we just left
+               // FIXME: move this code to Cursor::dispatch
                if (bv->cursor() != old) {
+                       old.beginUndoGroup();
                        old.fixIfBroken();
                        bool badcursor = notifyCursorLeavesOrEnters(old, bv->cursor());
-                       if (badcursor)
+                       if (badcursor) {
                                bv->cursor().fixIfBroken();
+                               bv->fixInlineCompletionPos();
+                       }
+                       old.endUndoGroup();
                }
        
                // update completion. We do it here and not in
@@ -1668,6 +1677,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                }
        
                dr = bv->cursor().result();
+
+               current_view_->setBusy(false);
        }
        
        // if we executed a mutating lfun, mark the buffer as dirty