]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiWorkArea.cpp
Revert "Do not display caret when we're not ready"
[features.git] / src / frontends / qt / GuiWorkArea.cpp
index 2500afe4db9621f46ceeca772b6c5c20b1987e5a..ab13c687d7c9d549299508303bea29a33371f30f 100644 (file)
@@ -439,6 +439,14 @@ void GuiWorkArea::stopBlinkingCaret()
 
 void GuiWorkArea::startBlinkingCaret()
 {
+       // do not show the cursor if the view is busy
+       if (view().busy())
+               return;
+
+       // Don't start blinking if the cursor isn't on screen.
+       if (!d->buffer_view_->caretInView())
+               return;
+
        d->showCaret();
 
        // Avoid blinking when debugging PAINTING, since it creates too much noise
@@ -633,26 +641,24 @@ void GuiWorkArea::Private::updateCaretGeometry()
 }
 
 
-void GuiWorkArea::Private::showCaret(bool show)
+void GuiWorkArea::Private::showCaret()
 {
-       if (caret_visible_ == show)
+       if (caret_visible_)
                return;
-       caret_visible_ = show;
 
-       /**
-        * Do not trigger the painting machinery if either
-        * 1. the view is busy (no updates at all)
-        * 2. The we are not ready because document is being modified (see bug #11763)
-        * 3. The caret is outside of screen anyway.
-        */
-       if (p->view().busy()
-           || buffer_view_->buffer().undo().activeUndoGroup()
-           || !buffer_view_->caretInView())
+       updateCaretGeometry();
+       p->viewport()->update();
+}
+
+
+void GuiWorkArea::Private::hideCaret()
+{
+       if (!caret_visible_)
                return;
 
-       if (caret_visible_)
-               updateCaretGeometry();
-       p->viewport()->update();
+       caret_visible_ = false;
+       //if (!qApp->focusWidget())
+               p->viewport()->update();
 }