From 64b85d5d4feddcee1867b92422907741c84082c7 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 2 Sep 2014 19:00:26 +0200 Subject: [PATCH] status: fix seeking with visualizer visible --- src/ncmpcpp.cpp | 2 +- src/status.cpp | 19 +++++++++++-------- src/status.h | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index b46f884..5d89ad5 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -208,7 +208,7 @@ int main(int argc, char **argv) } // update timer, status if necessary etc. - Status::trace(!key_pressed); + Status::trace(!key_pressed, true); if (run_resize_screen) { diff --git a/src/status.cpp b/src/status.cpp index e1f4612..4192569 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -131,7 +131,7 @@ void Status::handleServerError(MPD::ServerError &e) /*************************************************************************/ -void Status::trace(bool update_timer) +void Status::trace(bool update_timer, bool update_window_timeout) { if (update_timer) Timer = boost::posix_time::microsec_clock::local_time(); @@ -149,13 +149,16 @@ void Status::trace(bool update_timer) applyToVisibleWindows(&BaseScreen::update); Statusbar::tryRedraw(); - // set appropriate window timeout - int nc_wtimeout = std::numeric_limits::max(); - applyToVisibleWindows([&nc_wtimeout](BaseScreen *s) { - nc_wtimeout = std::min(nc_wtimeout, s->windowTimeout()); - }); - wFooter->setTimeout(nc_wtimeout); - + if (update_window_timeout) + { + // set appropriate window timeout + int nc_wtimeout = std::numeric_limits::max(); + applyToVisibleWindows([&nc_wtimeout](BaseScreen *s) { + nc_wtimeout = std::min(nc_wtimeout, s->windowTimeout()); + }); + wFooter->setTimeout(nc_wtimeout); + } + Mpd.idle(); } } diff --git a/src/status.h b/src/status.h index a4ec317..7a0d447 100644 --- a/src/status.h +++ b/src/status.h @@ -29,8 +29,8 @@ namespace Status {// void handleClientError(MPD::ClientError &e); void handleServerError(MPD::ServerError &e); -void trace(bool update_timer); -inline void trace() { trace(true); } +void trace(bool update_timer, bool update_window_timeout); +inline void trace() { trace(true, false); } void update(int event); namespace State {// -- 2.11.4.GIT