Code

keyboard: call wgetch() on main window
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 10:28:21 +0000 (11:28 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 11:19:47 +0000 (12:19 +0100)
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
src/keyboard.c

diff --git a/NEWS b/NEWS
index be34c1262e213f0b8cf03d2850d17c9b75d28127..b38762181d08f2e396f28631d12f1d9bf7de8899 100644 (file)
--- 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)
index d990e3691e7854d011672527062f9d51fc7ede70..5042af2a3648e9e0b1237e54b44de3fda42cb8a4 100644 (file)
@@ -21,6 +21,7 @@
 #include "command.h"
 #include "ncmpc.h"
 #include "ncmpc_curses.h"
+#include "screen.h"
 #include "Compiler.h"
 
 #include <glib.h>
@@ -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