From b36dd639213f5b8ac83e4126bdfa0bc12fa7b9ad Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 3 Feb 2007 06:53:22 +0000 Subject: [PATCH] For each operation, stop the blinking cursor before acting and restart it _after_ redrawing. This latter fixes the spurious cursor jumps in mathed. This was due to the fact that MathArray are filled-in at draw time (as opposed to text positions in the CoordCache which are filled in at metrics calculation time.) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17033 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/WorkArea.C | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index 51c28c6974..dc499eafa0 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -205,8 +205,17 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) else cmd = cmd0; - bool needRedraw = buffer_view_->workAreaDispatch(cmd); + // In order to avoid bad surprise in the middle of an operation, we better stop + // the blinking cursor. + if (!(cmd.action == LFUN_MOUSE_MOTION + && cmd.button() == mouse_button::none)) + stopBlinkingCursor(); + + bool const needRedraw = buffer_view_->workAreaDispatch(cmd); + if (needRedraw) + redraw(); + // Skip these when selecting if (cmd.action != LFUN_MOUSE_MOTION) { lyx_view_.updateLayoutChoice(); @@ -214,7 +223,6 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) lyx_view_.updateToolbars(); } - // GUI tweaks except with mouse motion with no button pressed. if (!(cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none)) { @@ -223,13 +231,9 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) // of the new status here. lyx_view_.clearMessage(); - // Show the cursor immediately after any operation. - hideCursor(); - toggleCursor(); + // Show the cursor immediately after any operation. + startBlinkingCursor(); } - - if (needRedraw) - redraw(); } @@ -255,14 +259,15 @@ void WorkArea::updateScrollbar() void WorkArea::scrollBufferView(int position) { + stopBlinkingCursor(); buffer_view_->scrollDocView(position); redraw(); - hideCursor(); if (lyxrc.cursor_follows_scrollbar) { buffer_view_->setCursorFromScrollbar(); lyx_view_.updateLayoutChoice(); } - toggleCursor(); + // Show the cursor immediately after any operation. + startBlinkingCursor(); } -- 2.39.5