Commit e52f9bb9 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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
parent e25d3d0c
...@@ -389,6 +389,15 @@ static void QZ_PumpEvents (_THIS) ...@@ -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 ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment