comparison src/video/quartz/SDL_QuartzEvents.m @ 3936:c5c3c772f5aa SDL-1.2

Let app set SDL_VIDEO_ALLOW_SCREENSAVER environment variable to override SDL's attempt to disable screen savers. Works for Quartz (Mac OS X) and X11. Need a formal API for this in 1.3, still. Fixes Bugzilla #415.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 06 Apr 2007 20:30:41 +0000
parents 4e02435ad2be
children e3c28caea46d
comparison
equal deleted inserted replaced
3935:00959c391aa6 3936:c5c3c772f5aa
732 732
733 if (!SDL_VideoSurface) 733 if (!SDL_VideoSurface)
734 return; /* don't do anything if there's no screen surface. */ 734 return; /* don't do anything if there's no screen surface. */
735 735
736 /* Update activity every five seconds to prevent screensaver. --ryan. */ 736 /* Update activity every five seconds to prevent screensaver. --ryan. */
737 nowTicks = SDL_GetTicks(); 737 if (!allow_screensaver) {
738 if ((nowTicks - screensaverTicks) > 5000) 738 nowTicks = SDL_GetTicks();
739 { 739 if ((nowTicks - screensaverTicks) > 5000)
740 UpdateSystemActivity(UsrActivity); 740 {
741 screensaverTicks = nowTicks; 741 UpdateSystemActivity(UsrActivity);
742 screensaverTicks = nowTicks;
743 }
742 } 744 }
743 745
744 pool = [ [ NSAutoreleasePool alloc ] init ]; 746 pool = [ [ NSAutoreleasePool alloc ] init ];
745 distantPast = [ NSDate distantPast ]; 747 distantPast = [ NSDate distantPast ];
746 748