]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkArea.C
Document pasteParagraphList as hinted by Jean-Marc
[lyx.git] / src / frontends / WorkArea.C
index 2d6663cf4d6acec823d8ad17ad2b706f603c0ce7..c2b8faf25c2638ed82d55d4da4f1fa7d6c958af2 100644 (file)
@@ -120,29 +120,23 @@ BufferView const & WorkArea::bufferView() const
 void WorkArea::stopBlinkingCursor()
 {
        cursor_timeout_.stop();
+       hideCursor();
 }
 
 
 void WorkArea::startBlinkingCursor()
 {
+       showCursor();
        cursor_timeout_.restart();
 }
 
 
-void WorkArea::checkAndGreyOut()
-{
-       if (greyed_out_)
-               greyOut();
-}
-
-
 void WorkArea::redraw(bool singlePar)
 {
-       if (!buffer_view_)
-               return;
-
-       if (!buffer_view_->buffer()) {
-               checkAndGreyOut();
+       if (!buffer_view_ || !buffer_view_->buffer()) {
+               greyed_out_ = true;
+               // The argument here are meaningless.
+               expose(1,1,1,1);
                return;
        }
 
@@ -173,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();
 }
 
 
@@ -200,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) {
@@ -218,8 +209,8 @@ void WorkArea::dispatch(FuncRequest const & cmd0)
        hideCursor();
        toggleCursor();
 
-       if (needRedraw)
-               redraw();
+       if (needRedraw.first)
+               redraw(needRedraw.second);
 }
 
 
@@ -257,13 +248,6 @@ void WorkArea::scrollBufferView(int position)
 }
 
 
-void WorkArea::greyOut()
-{
-       greyed_out_ = true;
-       expose(4, 5, 3, 3);
-}
-
-
 void WorkArea::showCursor()
 {
        if (cursor_visible_)