Disable MacOS X screensaver for duration of application run by triggering a
"UsrActivity" alert every five seconds in the Quartz PumpEvents implementation. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40620
This commit is contained in:
parent
e25d3d0c78
commit
e52f9bb94e
1 changed files with 9 additions and 0 deletions
|
@ -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 ];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue