Disable MacOS X screensaver for duration of application run by triggering a

"UsrActivity" alert every five seconds in the Quartz PumpEvents implementation.
This commit is contained in:
Ryan C. Gordon
2003-05-22 06:28:40 +00:00
parent 8d133f3f6f
commit 8b29e98df8

View File

@@ -389,6 +389,15 @@ static void QZ_PumpEvents (_THIS)
NSRect titleBarRect;
NSAutoreleasePool *pool;
/* Update activity every five seconds to prevent screensaver. --ryan. */
static Uint32 screensaverTicks = 0;
Uint32 nowTicks = SDL_GetTicks();
if ((nowTicks - screensaverTicks) > 5000)
{
UpdateSystemActivity(UsrActivity);
screensaverTicks = nowTicks;
}
pool = [ [ NSAutoreleasePool alloc ] init ];
distantPast = [ NSDate distantPast ];