Re: Preventing system sleep, QA1340 code does not seem to work
Re: Preventing system sleep, QA1340 code does not seem to work
- Subject: Re: Preventing system sleep, QA1340 code does not seem to work
- From: Ethan Bold <email@hidden>
- Date: Thu, 14 Dec 2006 11:04:35 -0800
On Dec 13, 2006, at 1:41 PM, Sean McBride wrote: But does 'idle sleep' include the display? That is, if in the callback I refuse idle sleep will both the display and cpu stay awake?
No, idle sleep does not include the display. Using the API's per QA1340 will prevent system sleep, but will allow the display to sleep normally. It sounds like this might be what you're seeing - the display sleeping while the system remains awake.
So you want to keep the display awake? The short answer is that it's pretty ugly API to do so; the even shorter answer is that all you have to do is call the Carbon.framework call UpdateSystemActivity() every 25 seconds. This generates a fake HID UI event, like a mouse move, frequently enough to prevent idle display sleep AND idle system sleep.
Note that the display must idle sleep before the system can idle sleep. This is a restriction of PM's idle sleep behavior; so if you prevent disply sleep with NULL HID activity (via UpdateSystemActivity()), the system will never idle sleep either.
-Ethan |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden