mirror of https://github.com/BOINC/boinc.git
SCR: Mac: replace all deprecated Mac APIs as of OS 10.12.
This commit is contained in:
parent
5d12d626c2
commit
58f6978c1e
|
@ -264,9 +264,6 @@ int signof(float x) {
|
|||
char *msg;
|
||||
CFStringRef cf_msg;
|
||||
double timeToBlock, frameStartTime = getDTime();
|
||||
kern_return_t kernResult = kIOReturnError;
|
||||
UInt64 params;
|
||||
IOByteCount rcnt = sizeof(UInt64);
|
||||
double idleTime = 0;
|
||||
HIThemeTextInfo textInfo;
|
||||
|
||||
|
@ -291,18 +288,16 @@ int signof(float x) {
|
|||
return;
|
||||
}
|
||||
|
||||
// For unkown reasons, OS 10.7 Lion screensaver delays several seconds after
|
||||
// user activity before calling stopAnimation, so we check user activity here
|
||||
// For unkown reasons, OS 10.7 Lion screensaver and later delay several seconds
|
||||
// after user activity before calling stopAnimation, so we check user activity here
|
||||
if ((compareOSVersionTo(10, 7) >= 0) && ((getDTime() - gSS_StartTime) > 2.0)) {
|
||||
kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt );
|
||||
if ( kernResult == kIOReturnSuccess ) {
|
||||
idleTime = ((double)params) / 1000.0 / 1000.0 / 1000.0;
|
||||
if (idleTime < 1.5) {
|
||||
[ NSApp terminate:nil ];
|
||||
}
|
||||
idleTime = CGEventSourceSecondsSinceLastEventType
|
||||
(kCGEventSourceStateCombinedSessionState, kCGAnyInputEventType);
|
||||
if (idleTime < 1.5) {
|
||||
[ NSApp terminate:nil ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
myContext = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
// [myContext retain];
|
||||
|
||||
|
|
Loading…
Reference in New Issue