mirror of https://github.com/BOINC/boinc.git
client: use old Mac idle detection when running as a daemon
svn path=/trunk/boinc/; revision=25038
This commit is contained in:
parent
4538282220
commit
9e52a9db5c
|
@ -439,3 +439,14 @@ Rom 12 Jan 2012
|
||||||
|
|
||||||
samples/vboxwrapper
|
samples/vboxwrapper
|
||||||
vboxwrapper.cpp
|
vboxwrapper.cpp
|
||||||
|
|
||||||
|
Charlie 13 Jan 2012
|
||||||
|
- client: Due to my changes of 10 Jan 2012, idle detection did not work
|
||||||
|
when BOINC was run as a pre-login daemon. So use the old method
|
||||||
|
when running as a daemon. This means that idle detection for Apple
|
||||||
|
Remote Desktop and screen sharing (VNC) under Mac OS 10.7 works only
|
||||||
|
when not running BOINC as a daemon.
|
||||||
|
|
||||||
|
client/
|
||||||
|
hostinfo_unix.cpp
|
||||||
|
|
||||||
|
|
|
@ -1587,9 +1587,12 @@ inline bool user_idle(time_t t, struct utmp* u) {
|
||||||
// In OS 10.7, IOHIDGetParameter() fails to recognize activity from remote
|
// In OS 10.7, IOHIDGetParameter() fails to recognize activity from remote
|
||||||
// logins via Apple Remote Desktop or Screen Sharing (VNC), but the
|
// logins via Apple Remote Desktop or Screen Sharing (VNC), but the
|
||||||
// CGEventSourceSecondsSinceLastEventType() API does work with ARD and VNC,
|
// CGEventSourceSecondsSinceLastEventType() API does work with ARD and VNC,
|
||||||
// and CGEventSourceSecondsSinceLastEventType() does work even when BOINC
|
// except when BOINC is a pre-login launchd daemon running as user boinc_master.
|
||||||
// is a pre-login launchd daemon running as user boinc_master, provided that
|
//
|
||||||
// it is not called too soon after system restart.
|
// So as a workaround in OS 10.7, we use CGEventSourceSecondsSinceLastEventType
|
||||||
|
// unless running as a daemon. Therefore BOINC still won't detect activity from
|
||||||
|
// remote via Apple Remote Desktop or Screen Sharing (VNC) when run as a daemon
|
||||||
|
// under OS 10.7.
|
||||||
//
|
//
|
||||||
// So we use weak-linking of NxIdleTime() to prevent a run-time crash from the
|
// So we use weak-linking of NxIdleTime() to prevent a run-time crash from the
|
||||||
// dynamic linker and use it if it exists.
|
// dynamic linker and use it if it exists.
|
||||||
|
@ -1644,11 +1647,10 @@ bool HOST_INFO::users_idle(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // NXIdleTime API does not exist in OS 10.6 and later
|
} else { // NXIdleTime API does not exist in OS 10.6 and later
|
||||||
if (OSVersionInfo >= 0x1070) {
|
if ((OSVersionInfo >= 0x1070) && (! gstate.executing_as_daemon)) {
|
||||||
if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes
|
|
||||||
idleTime = CGEventSourceSecondsSinceLastEventType
|
idleTime = CGEventSourceSecondsSinceLastEventType
|
||||||
(kCGEventSourceStateCombinedSessionState, kCGAnyInputEventType);
|
(kCGEventSourceStateCombinedSessionState, kCGAnyInputEventType);
|
||||||
}
|
|
||||||
} else { // OS Version < 10.7
|
} else { // OS Version < 10.7
|
||||||
if (gEventHandle) {
|
if (gEventHandle) {
|
||||||
kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt );
|
kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt );
|
||||||
|
|
Loading…
Reference in New Issue