]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkArea.C
hopefully fix tex2lyx linking.
[lyx.git] / src / frontends / WorkArea.C
index 17cac2a849c0214617a3ed0f491e02eaa22176da..c2b8faf25c2638ed82d55d4da4f1fa7d6c958af2 100644 (file)
@@ -120,11 +120,13 @@ BufferView const & WorkArea::bufferView() const
 void WorkArea::stopBlinkingCursor()
 {
        cursor_timeout_.stop();
+       hideCursor();
 }
 
 
 void WorkArea::startBlinkingCursor()
 {
+       showCursor();
        cursor_timeout_.restart();
 }
 
@@ -165,20 +167,17 @@ void WorkArea::redraw(bool singlePar)
 void WorkArea::processKeySym(LyXKeySymPtr key,
                                                         key_modifier::state state)
 {
-       hideCursor();
+       // In order to avoid bad surprise in the middle of an operation, we better stop
+       // the blinking cursor.
+       stopBlinkingCursor();
 
        theLyXFunc().setLyXView(&lyx_view_);
        theLyXFunc().processKeySym(key, state);
 
-       /* This is perhaps a bit of a hack. When we move
-        * around, or type, it's nice to be able to see
-        * the cursor immediately after the keypress. So
-        * we reset the toggle timeout and force the visibility
-        * of the cursor. Note we cannot do this inside
-        * dispatch() itself, because that's called recursively.
+       /* When we move around, or type, it's nice to be able to see
+        * the cursor immediately after the keypress.
         */
-//     if (buffer_view_->buffer())
-       toggleCursor();
+       startBlinkingCursor();
 }
 
 
@@ -192,7 +191,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0)
 
        theLyXFunc().setLyXView(&lyx_view_);
 
-       bool needRedraw = buffer_view_->workAreaDispatch(cmd0);
+       std::pair<bool, bool> needRedraw = buffer_view_->workAreaDispatch(cmd0);
 
        // Skip these when selecting
        if (cmd0.action != LFUN_MOUSE_MOTION) {
@@ -210,8 +209,8 @@ void WorkArea::dispatch(FuncRequest const & cmd0)
        hideCursor();
        toggleCursor();
 
-       if (needRedraw)
-               redraw();
+       if (needRedraw.first)
+               redraw(needRedraw.second);
 }