From f89638635a634db782ca9f6daeacb75f911ab9e1 Mon Sep 17 00:00:00 2001 From: Marin Ivanov Date: Wed, 27 Jul 2016 02:07:31 +0200 Subject: [PATCH 1/2] Remove help window flicker --- src/prompt.c | 2 +- src/windows.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index 4fbc8c6..4b8c978 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -369,7 +369,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) int new_x = ctx->start ? x2 - 1 : MAX(0, wcswidth(ctx->line, ctx->pos)); wmove(self->window, y + 1, new_x); - wrefresh(self->window); + wnoutrefresh(self->window); if (self->help->active) help_onDraw(self); diff --git a/src/windows.c b/src/windows.c index 0116a5a..8a6c6c9 100644 --- a/src/windows.c +++ b/src/windows.c @@ -471,6 +471,11 @@ static void draw_window_tab(ToxWindow *toxwin) static void draw_bar(void) { + int y,x; + + // save current cursor position + getyx(active_window->window, y, x); + attron(COLOR_PAIR(BLUE)); mvhline(LINES - 2, 0, '_', COLS); attroff(COLOR_PAIR(BLUE)); @@ -508,6 +513,9 @@ static void draw_bar(void) attroff(A_BOLD); } + // restore cursor position after drawing + move(y, x); + refresh(); } From c425aa2f27987687b5a563c8fa56857aac41880f Mon Sep 17 00:00:00 2001 From: Marin Ivanov Date: Wed, 27 Jul 2016 18:06:33 +0200 Subject: [PATCH 2/2] Fixed input lag --- src/windows.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/windows.c b/src/windows.c index 8a6c6c9..5414b4b 100644 --- a/src/windows.c +++ b/src/windows.c @@ -533,6 +533,7 @@ void draw_active_window(Tox *m) touchwin(a->window); a->onDraw(a, m); + wrefresh(a->window); /* Handle input */ bool ltr;