do not monitor mpdclient file descriptor with select() if idle is off
it doesn't do anything in such case.
This commit is contained in:
@@ -275,6 +275,7 @@ int main(int argc, char *argv[])
|
|||||||
wFooter = new Window(0, footer_start_y, COLS, footer_height, "", Config.statusbar_color, brNone);
|
wFooter = new Window(0, footer_start_y, COLS, footer_height, "", Config.statusbar_color, brNone);
|
||||||
wFooter->SetTimeout(ncmpcpp_window_timeout);
|
wFooter->SetTimeout(ncmpcpp_window_timeout);
|
||||||
wFooter->SetGetStringHelper(StatusbarGetStringHelper);
|
wFooter->SetGetStringHelper(StatusbarGetStringHelper);
|
||||||
|
if (Mpd.SupportsIdle())
|
||||||
wFooter->AddFDCallback(Mpd.GetFD(), StatusbarMPDCallback);
|
wFooter->AddFDCallback(Mpd.GetFD(), StatusbarMPDCallback);
|
||||||
wFooter->CreateHistory();
|
wFooter->CreateHistory();
|
||||||
|
|
||||||
@@ -333,6 +334,7 @@ int main(int argc, char *argv[])
|
|||||||
if (Mpd.Connect())
|
if (Mpd.Connect())
|
||||||
{
|
{
|
||||||
ShowMessage("Connected to %s!", Mpd.GetHostname().c_str());
|
ShowMessage("Connected to %s!", Mpd.GetHostname().c_str());
|
||||||
|
if (Mpd.SupportsIdle())
|
||||||
wFooter->AddFDCallback(Mpd.GetFD(), StatusbarMPDCallback);
|
wFooter->AddFDCallback(Mpd.GetFD(), StatusbarMPDCallback);
|
||||||
MessagesAllowed = 0;
|
MessagesAllowed = 0;
|
||||||
UpdateStatusImmediately = 1;
|
UpdateStatusImmediately = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user