Skip to content

Commit

Permalink
screen: skip ageing on cursor move if hidden
Browse files Browse the repository at this point in the history
If the cursor is hidden we don't need to increase the age. We already do
this whenever the HIDE_CURSOR flag is changed.

Signed-off-by: David Herrmann <[email protected]>
  • Loading branch information
David Herrmann committed Oct 23, 2013
1 parent e6e0f6a commit bd52696
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tsm_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ static void move_cursor(struct tsm_screen *con, unsigned int x, unsigned int y)
{
struct cell *c;

/* if cursor is hidden, just move it */
if (con->flags & TSM_SCREEN_HIDE_CURSOR) {
con->cursor_x = x;
con->cursor_y = y;
return;
}

/* If cursor is visible, we have to mark the current and the new cell
* as changed by resetting their age. We skip it if the cursor-position
* didn't actually change. */

if (con->cursor_x == x && con->cursor_y == y)
return;

Expand Down

0 comments on commit bd52696

Please sign in to comment.