screen: skip ageing on cursor move if hidden
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 23 Oct 2013 18:24:42 +0000 (20:24 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 23 Oct 2013 18:24:42 +0000 (20:24 +0200)
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>
src/tsm_screen.c

index f8e2b69..fd61d37 100644 (file)
@@ -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;