diff --git a/ss/SSMain.cc b/ss/SSMain.cc index 7637736..b6796d2 100644 --- a/ss/SSMain.cc +++ b/ss/SSMain.cc @@ -22,6 +22,7 @@ /* switch to the next screensaver mode after this many milliseconds */ #define SSMODE_TIMEOUT_MSEC (1000*45) +#define SCREENSAVER_MAX_RUNTIME (30*60*1000) static SDL_Event event; @@ -86,6 +87,10 @@ void SSMain::run() while (SDL_WaitEvent(&event)) { elapsed_msec = SDL_GetTicks(); /* get the time the event occurred at */ +#if SCREENSAVER_MAX_RUNTIME > 0 + if (elapsed_msec >= SCREENSAVER_MAX_RUNTIME) + goto RET; +#endif if (elapsed_msec - lastChanged_msec > SSMODE_TIMEOUT_MSEC) { delete m_mode;