summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 20:24:42 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 20:24:42 +0200
commitbd52696633247055ecd8e7aedb99394d84433d29 (patch)
tree7f816301a266689e343636800e4ec9ebf5153f5d
parente6e0f6a4ca4df7cd5d6c5d4f3f87416c4af90a8d (diff)
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 <dh.herrmann@gmail.com>
-rw-r--r--src/tsm_screen.c11
1 files changed, 11 insertions, 0 deletions
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;