[PATCH] MacOS X screensaver disable

Patch to trigger “system activity” in PumpEvents every five seconds, to
prevent the screensaver and/or display going into sleep mode.

(Thanks for the pointer on this one, Darrell!)

If there are no objections, I’ll commit it to CVS.

–ryan.

Index: src/video/quartz/SDL_QuartzEvents.m===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.21
diff -u -r1.21 SDL_QuartzEvents.m
— src/video/quartz/SDL_QuartzEvents.m 20 Apr 2003 05:41:16 -0000 1.21
+++ src/video/quartz/SDL_QuartzEvents.m 21 May 2003 19:25:13 -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 ];

Patch to trigger “system activity” in PumpEvents every five seconds, to
prevent the screensaver and/or display going into sleep mode.

(Thanks for the pointer on this one, Darrell!)

If there are no objections, I’ll commit it to CVS.

Sounds good. Now we need something similar for X11. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment