wreadln, screen_utils: avoid busy looping wgetch()
authorMax Kellermann <max@musicpd.org>
Tue, 9 Apr 2019 21:25:06 +0000 (23:25 +0200)
committerMax Kellermann <max@musicpd.org>
Tue, 9 Apr 2019 21:25:06 +0000 (23:25 +0200)
commit79b967b6ed274fd765d7cc155286208f5c9491e4
treed818a4b895d360b62ca63b5657ebdff3866e595d
parenta3a211fd4e5d6ec8b5ad6016b9e718fc987c8ad9
wreadln, screen_utils: avoid busy looping wgetch()

boost::asio switches STDIN_FILENO to non-blocking mode, causing
wgetch() to always return immediately, causing EAGAIN if no key press
is pending.  This causes wreadln() and screen_getch() to busy-loop.

This commit adds poll() calls to idle while no key press is pending.

Closes https://github.com/MusicPlayerDaemon/ncmpc/issues/50
NEWS
src/WaitUserInput.hxx
src/screen_utils.cxx
src/wreadln.cxx