From ae5ccc75cb3b3053fd4b36fba0c8a95a8645e362 Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Tue, 31 May 2011 03:31:36 -0300 Subject: [PATCH] Fixed screen flicker on cursor movement. --- src/cursor.c | 2 +- src/display.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cursor.c b/src/cursor.c index 1e682d6..0f08a0a 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -19,7 +19,7 @@ void allocate_cursor(struct cursor **cursor) { } void initialize_cursor(struct cursor *cursor) { - cursor->window = newwin(0, 0, cursor->y, cursor->x); + cursor->window = newwin(1, 1, cursor->y, cursor->x); cursor->x = CURSOR_BEGIN_X; cursor->y = CURSOR_BEGIN_Y; cursor->marked = false; diff --git a/src/display.c b/src/display.c index b11cb61..dde3bf3 100644 --- a/src/display.c +++ b/src/display.c @@ -145,13 +145,16 @@ void draw_deck(struct deck *deck) { void draw_cursor(struct cursor *cursor) { if (cursor->marked) { - mvwaddch(cursor->window, cursor->y, cursor->x, '@'); + mvwin(cursor->window, cursor->y, cursor->x); + waddch(cursor->window, '@'); } else { - mvwaddch(cursor->window, cursor->y, cursor->x, '*'); + mvwin(cursor->window, cursor->y, cursor->x); + waddch(cursor->window, '*'); } wrefresh(cursor->window); } void erase_cursor(struct cursor *cursor) { - mvwdelch(cursor->window, cursor->y, cursor->x); + wdelch(cursor->window); + wrefresh(cursor->window); }