Better fix for showing visualiser immediately after startup
This commit is contained in:
@@ -189,9 +189,6 @@ int main(int argc, char **argv)
|
|||||||
Mpd.Disconnect();
|
Mpd.Disconnect();
|
||||||
throw MPD::ClientError(MPD_ERROR_STATE, "MPD < 0.16.0 is not supported", false);
|
throw MPD::ClientError(MPD_ERROR_STATE, "MPD < 0.16.0 is not supported", false);
|
||||||
}
|
}
|
||||||
// Once the connection is established, run full Status::trace to set a
|
|
||||||
// proper window timeout, initialize status etc.
|
|
||||||
Status::trace(true, true);
|
|
||||||
}
|
}
|
||||||
catch (MPD::ClientError &e)
|
catch (MPD::ClientError &e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -209,15 +209,6 @@ void Status::trace(bool update_timer, bool update_window_timeout)
|
|||||||
{
|
{
|
||||||
if (update_timer)
|
if (update_timer)
|
||||||
Timer = boost::posix_time::microsec_clock::local_time();
|
Timer = boost::posix_time::microsec_clock::local_time();
|
||||||
if (update_window_timeout)
|
|
||||||
{
|
|
||||||
// set appropriate window timeout
|
|
||||||
int nc_wtimeout = std::numeric_limits<int>::max();
|
|
||||||
applyToVisibleWindows([&nc_wtimeout](BaseScreen *s) {
|
|
||||||
nc_wtimeout = std::min(nc_wtimeout, s->windowTimeout());
|
|
||||||
});
|
|
||||||
wFooter->setTimeout(nc_wtimeout);
|
|
||||||
}
|
|
||||||
if (Mpd.Connected())
|
if (Mpd.Connected())
|
||||||
{
|
{
|
||||||
if (!m_status_initialized)
|
if (!m_status_initialized)
|
||||||
@@ -237,6 +228,16 @@ void Status::trace(bool update_timer, bool update_window_timeout)
|
|||||||
|
|
||||||
Mpd.idle();
|
Mpd.idle();
|
||||||
}
|
}
|
||||||
|
// Update timeout after MPD as it may depend on its status.
|
||||||
|
if (update_window_timeout)
|
||||||
|
{
|
||||||
|
// set appropriate window timeout
|
||||||
|
int nc_wtimeout = std::numeric_limits<int>::max();
|
||||||
|
applyToVisibleWindows([&nc_wtimeout](BaseScreen *s) {
|
||||||
|
nc_wtimeout = std::min(nc_wtimeout, s->windowTimeout());
|
||||||
|
});
|
||||||
|
wFooter->setTimeout(nc_wtimeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Status::update(int event)
|
void Status::update(int event)
|
||||||
|
|||||||
Reference in New Issue
Block a user