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

"UsrActivity" alert every five seconds in the Quartz PumpEvents implementation.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40620
This commit is contained in:
Ryan C. Gordon 2003-05-22 06:28:40 +00:00
parent e25d3d0c78
commit e52f9bb94e

View file

@ -389,6 +389,15 @@ static void QZ_PumpEvents (_THIS)
NSRect titleBarRect; NSRect titleBarRect;
NSAutoreleasePool *pool; 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 ]; pool = [ [ NSAutoreleasePool alloc ] init ];
distantPast = [ NSDate distantPast ]; distantPast = [ NSDate distantPast ];