Skip to content
Permalink
Browse files

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 d55ffb77ac774f36662051a5ed5d007c0c2a52b0
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/video/quartz/SDL_QuartzEvents.m
@@ -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 ];

0 comments on commit d55ffb7

Please sign in to comment.