From: Max Kellermann Date: Mon, 20 Mar 2017 10:28:21 +0000 (+0100) Subject: keyboard: call wgetch() on main window X-Git-Tag: v0.26~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e79707f956f639af800abe2180f15d3ac3107d58;p=ncmpc.git 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. --- 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