Commit be1acb05 authored by Robert Knight's avatar Robert Knight
Browse files

Fix redraw of cursor when terminal display loses and then regains focus with...

Fix redraw of cursor when terminal display loses and then regains focus with cursor blinking disabled.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=765974
parent 65f20479
......@@ -1069,10 +1069,10 @@ void TerminalDisplay::focusOutEvent(QFocusEvent*)
// trigger a repaint of the cursor so that it is both visible (in case
// it was hidden during blinking)
// and drawn in a focused out state
_cursorBlinking = true;
blinkCursorEvent();
_blinkCursorTimer->stop();
_cursorBlinking = false;
updateCursor();
_blinkCursorTimer->stop();
if (_blinking)
blinkEvent();
......@@ -1083,8 +1083,9 @@ void TerminalDisplay::focusInEvent(QFocusEvent*)
if (_hasBlinkingCursor)
{
_blinkCursorTimer->start();
blinkCursorEvent();
}
updateCursor();
if (_hasBlinker)
_blinkTimer->start();
}
......@@ -1379,15 +1380,18 @@ QRect TerminalDisplay::imageToWidget(const QRect& imageArea) const
return result;
}
void TerminalDisplay::blinkCursorEvent()
void TerminalDisplay::updateCursor()
{
_cursorBlinking = !_cursorBlinking;
QRect cursorRect = imageToWidget( QRect(cursorPosition(),QSize(1,1)) );
update(cursorRect);
}
void TerminalDisplay::blinkCursorEvent()
{
_cursorBlinking = !_cursorBlinking;
updateCursor();
}
/* ------------------------------------------------------------------------- */
/* */
/* Resizing */
......
......@@ -621,6 +621,9 @@ private:
// returns the position of the cursor in columns and lines
QPoint cursorPosition() const;
// redraws the cursor
void updateCursor();
// the window onto the terminal screen which this display
// is currently showing.
QPointer<ScreenWindow> _screenWindow;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment