Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Disable MacOS X screensaver for duration of application run by trigge…
…ring a

"UsrActivity" alert every five seconds in the Quartz PumpEvents implementation.
  • Loading branch information
icculus committed May 22, 2003
1 parent 2c643e8 commit d55ffb7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video/quartz/SDL_QuartzEvents.m
Expand Up @@ -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 ];

Expand Down

0 comments on commit d55ffb7

Please sign in to comment.