console: hide cursor if requested
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 14 Jul 2012 17:31:37 +0000 (19:31 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 14 Jul 2012 17:31:37 +0000 (19:31 +0200)
When the HIDE_CURSOR flag is set, we must not draw the cursor.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/console.c

index 9627813..c97e613 100644 (file)
@@ -749,7 +749,8 @@ void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr)
                        if (k == cur_y + 1 &&
                            j == cur_x) {
                                cursor_done = true;
-                               attr.inverse = !attr.inverse;
+                               if (!(con->flags & KMSCON_CONSOLE_HIDE_CURSOR))
+                                       attr.inverse = !attr.inverse;
                        }
 
                        /* TODO: do some more sophisticated inverse here. When
@@ -764,10 +765,12 @@ void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr)
 
                if (k == cur_y + 1 && !cursor_done) {
                        cursor_done = true;
-                       if (!(con->flags & KMSCON_CONSOLE_INVERSE))
-                               attr.inverse = !attr.inverse;
-                       font_screen_draw_char(fscr, 0, &attr,
-                                             cur_x, i, 1, 1);
+                       if (!(con->flags & KMSCON_CONSOLE_HIDE_CURSOR)) {
+                               if (!(con->flags & KMSCON_CONSOLE_INVERSE))
+                                       attr.inverse = !attr.inverse;
+                               font_screen_draw_char(fscr, 0, &attr,
+                                                     cur_x, i, 1, 1);
+                       }
                }
        }