audioplayer/screensaver: refresh screensaver picture when title was changed

Origin commit data
------------------
Commit: 21638a1998
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-06-01 (Fri, 01 Jun 2018)

Origin message was:
------------------
- audioplayer/screensaver: refresh screensaver picture when title was changed
This commit is contained in:
vanhofen
2018-06-01 23:32:04 +02:00
parent c501e9ee7f
commit ec7163afa9
3 changed files with 18 additions and 2 deletions

View File

@@ -64,6 +64,7 @@ CScreenSaver::CScreenSaver()
clr.i_color = COL_DARK_GRAY;
pip_channel_id = 0;
idletime = time(NULL);
force_refresh = false;
}
CScreenSaver::~CScreenSaver()
@@ -183,11 +184,20 @@ void* CScreenSaver::ScreenSaverPrg(void* arg)
{
PScreenSaver->ReadDir();
PScreenSaver->paint();
sleep(g_settings.screensaver_timeout);
int t = g_settings.screensaver_timeout;
while (t--)
{
sleep(1);
if (PScreenSaver->force_refresh)
{
PScreenSaver->force_refresh = false;
break;
}
}
}
}
else
PScreenSaver->paint(); //just paint first found picture
PScreenSaver->paint();
return 0;
}