From e79707f956f639af800abe2180f15d3ac3107d58 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Mar 2017 11:28:21 +0100 Subject: [PATCH] keyboard: call wgetch() on main window This erases all the windows, and requires them to repaint. Strangely, ncurses does this only in color mode. Anyway, this greatly reduces the amount of data transferred to stdout, and fixes the flickering problems. --- NEWS | 1 + src/keyboard.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index be34c12..b387621 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ncmpc 0.26 - not yet released * lyricswiki: update regex * screen_song: show "f" and "dsd" formats * connect asynchronously +* fix flickering in color mode * fix gcc 7 warnings ncmpc 0.25 - (2016-08-18) diff --git a/src/keyboard.c b/src/keyboard.c index d990e36..5042af2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -21,6 +21,7 @@ #include "command.h" #include "ncmpc.h" #include "ncmpc_curses.h" +#include "screen.h" #include "Compiler.h" #include @@ -45,7 +46,7 @@ translate_key(int key) static command_t get_keyboard_command(void) { - return translate_key(wgetch(stdscr)); + return translate_key(wgetch(screen.main_window.w)); } static gboolean -- 2.30.2