diff src/video/quartz/SDL_QuartzEvents.m @ 619:bf816ce70144

Disable MacOS X screensaver for duration of application run by triggering a "UsrActivity" alert every five seconds in the Quartz PumpEvents implementation.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 22 May 2003 06:28:40 +0000
parents 7ec821f3cbd0
children fb78cadbfeb8
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzEvents.m	Sat May 03 19:48:37 2003 +0000
+++ b/src/video/quartz/SDL_QuartzEvents.m	Thu May 22 06:28:40 2003 +0000
@@ -389,6 +389,15 @@
     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 ];