mirror of https://github.com/BOINC/boinc.git
Mac SCR: Do screen blanking in screensaver since CC no longer does it
svn path=/trunk/boinc/; revision=13543
This commit is contained in:
parent
f2ea5d5fd9
commit
7da882ed50
|
@ -475,7 +475,7 @@ OSStatus RPCThread(void* param) {
|
||||||
CC_STATE state;
|
CC_STATE state;
|
||||||
CC_STATUS cc_status;
|
CC_STATUS cc_status;
|
||||||
AbsoluteTime timeToUnblock;
|
AbsoluteTime timeToUnblock;
|
||||||
long time_to_blank;
|
time_t time_to_blank;
|
||||||
pid_t graphics_app_pid = 0;
|
pid_t graphics_app_pid = 0;
|
||||||
pid_t launcher_shell_pid = 0;
|
pid_t launcher_shell_pid = 0;
|
||||||
char statusBuf[256];
|
char statusBuf[256];
|
||||||
|
@ -493,7 +493,19 @@ OSStatus RPCThread(void* param) {
|
||||||
double last_change_time = 0.0;
|
double last_change_time = 0.0;
|
||||||
double last_run_check_time = 0.0;
|
double last_run_check_time = 0.0;
|
||||||
|
|
||||||
|
// Calculate the estimated blank time by adding the starting
|
||||||
|
// time and and the user-specified time which is in minutes
|
||||||
|
if (gGoToBlank)
|
||||||
|
time_to_blank = SaverStartTime + (gBlankingTime * 60);
|
||||||
|
else
|
||||||
|
time_to_blank = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if ((gGoToBlank) && (time(0) > time_to_blank)) {
|
||||||
|
gClientSaverStatus = SS_STATUS_BLANKED;
|
||||||
|
gQuitRPCThread = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (gQuitRPCThread) { // If main thread has requested we exit
|
if (gQuitRPCThread) { // If main thread has requested we exit
|
||||||
if (graphics_app_pid) {
|
if (graphics_app_pid) {
|
||||||
terminate_screensaver(graphics_app_pid);
|
terminate_screensaver(graphics_app_pid);
|
||||||
|
@ -507,13 +519,6 @@ OSStatus RPCThread(void* param) {
|
||||||
timeToUnblock = AddDurationToAbsolute(durationSecond/2, UpTime());
|
timeToUnblock = AddDurationToAbsolute(durationSecond/2, UpTime());
|
||||||
MPDelayUntil(&timeToUnblock);
|
MPDelayUntil(&timeToUnblock);
|
||||||
|
|
||||||
// Calculate the estimated blank time by adding the starting
|
|
||||||
// time and and the user-specified time which is in minutes
|
|
||||||
if (gGoToBlank)
|
|
||||||
time_to_blank = SaverStartTime + (gBlankingTime * 60);
|
|
||||||
else
|
|
||||||
time_to_blank = 0;
|
|
||||||
|
|
||||||
// Try and get the current state of the CC
|
// Try and get the current state of the CC
|
||||||
//Get_CC_State:
|
//Get_CC_State:
|
||||||
retval = rpc->get_state(state);
|
retval = rpc->get_state(state);
|
||||||
|
@ -528,6 +533,11 @@ OSStatus RPCThread(void* param) {
|
||||||
saverState = SaverState_CoreClientSetToSaverMode;
|
saverState = SaverState_CoreClientSetToSaverMode;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if ((gGoToBlank) && (time(0) > time_to_blank)) {
|
||||||
|
gClientSaverStatus = SS_STATUS_BLANKED;
|
||||||
|
gQuitRPCThread = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (gQuitRPCThread) { // If main thread has requested we exit
|
if (gQuitRPCThread) { // If main thread has requested we exit
|
||||||
if (graphics_app_pid) {
|
if (graphics_app_pid) {
|
||||||
terminate_screensaver(graphics_app_pid);
|
terminate_screensaver(graphics_app_pid);
|
||||||
|
|
Loading…
Reference in New Issue