From bd52696633247055ecd8e7aedb99394d84433d29 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Oct 2013 20:24:42 +0200 Subject: [PATCH] screen: skip ageing on cursor move if hidden 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 --- src/tsm_screen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tsm_screen.c b/src/tsm_screen.c index f8e2b69..fd61d37 100644 --- a/src/tsm_screen.c +++ b/src/tsm_screen.c @@ -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; -- 2.7.4