From b85aa43d87ea0fa32364532592d05384bd27226e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 29 Dec 2014 22:05:51 +0100 Subject: [PATCH] - screensaver: allow no screensaver_timeout to show first pic only Thats usefull when you have just one plain black pic in your screensaver directory. So you'll get a blank screen w/o pic changes. --- src/gui/osd_setup.cpp | 2 +- src/gui/screensaver.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 89e8a1590..0b0e83df4 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1278,7 +1278,7 @@ void COsdSetup::showOsdScreensaverSetup(CMenuWidget *menu_screensaver) menu_screensaver->addItem(nc); // screensaver timeout - nc = new CMenuOptionNumberChooser(LOCALE_SCREENSAVER_TIMEOUT, &g_settings.screensaver_timeout, true, 0, 60); + nc = new CMenuOptionNumberChooser(LOCALE_SCREENSAVER_TIMEOUT, &g_settings.screensaver_timeout, true, 0, 60, NULL, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); nc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_SECOND)); nc->setHint("", LOCALE_MENU_HINT_SCREENSAVER_TIMEOUT); menu_screensaver->addItem(nc); diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index ebc3827d5..e66dbfbca 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -121,11 +121,17 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) PScreenSaver->ReadDir(); //TODO kill Screensaver if false PScreenSaver->m_frameBuffer->Clear(); - while(1) + if (g_settings.screensaver_timeout) { - PScreenSaver->PaintPicture(); - sleep(g_settings.screensaver_timeout); + while(1) + { + PScreenSaver->PaintPicture(); + sleep(g_settings.screensaver_timeout); + } } + else + PScreenSaver->PaintPicture(); //just paint first found picture + return 0; }