]> git.lyx.org Git - features.git/commitdiff
Since we don't do anything if the cursor isn't in view, do that test
authorRichard Heck <rgheck@comcast.net>
Fri, 19 Mar 2010 16:11:58 +0000 (16:11 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 19 Mar 2010 16:11:58 +0000 (16:11 +0000)
first.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33803 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.cpp

index 2d682d3aeee4c6f9c90063c1416e5e82450f0e83..14c972bbc0b71fca6804434301396fb5b70728da 100644 (file)
@@ -397,6 +397,7 @@ void GuiWorkArea::stopBlinkingCursor()
 void GuiWorkArea::startBlinkingCursor()
 {
        showCursor();
+
        //we're not supposed to cache this value.
        int const time = QApplication::cursorFlashTime() / 2;
        if (time <= 0)
@@ -544,6 +545,12 @@ void GuiWorkArea::showCursor()
        if (cursor_visible_)
                return;
 
+       Point p;
+       int h = 0;
+       buffer_view_->cursorPosAndHeight(p, h);
+       if (!buffer_view_->cursorInView(p, h))
+               return;
+
        // RTL or not RTL
        bool l_shape = false;
        Font const & realfont = buffer_view_->cursor().real_current_font;
@@ -558,19 +565,14 @@ void GuiWorkArea::showCursor()
        if (realfont.language() == latex_language)
                l_shape = false;
 
-       Point p;
-       int h = 0;
-       buffer_view_->cursorPosAndHeight(p, h);
        // show cursor on screen
        Cursor & cur = buffer_view_->cursor();
        bool completable = cur.inset().showCompletionCursor()
                && completer_->completionAvailable()
                && !completer_->popupVisible()
                && !completer_->inlineVisible();
-       if (buffer_view_->cursorInView(p, h)) {
-               cursor_visible_ = true;
-               showCursor(p.x_, p.y_, h, l_shape, isrtl, completable);
-       }
+       cursor_visible_ = true;
+       showCursor(p.x_, p.y_, h, l_shape, isrtl, completable);
 }