void WorkArea::stopBlinkingCursor()
{
cursor_timeout_.stop();
+ hideCursor();
}
void WorkArea::startBlinkingCursor()
{
+ showCursor();
cursor_timeout_.restart();
}
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();
}
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) {
hideCursor();
toggleCursor();
- if (needRedraw)
- redraw();
+ if (needRedraw.first)
+ redraw(needRedraw.second);
}