Re: Preventing system sleep, QA1340 code does not seem to work
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Organization: Rogue Research On 2006-12-12 14:55, Ethan Bold said:
To be clear, the kIOMessageCanSystemSleep message only allows you to prevent IDLE sleep. If you close the clamshell or sleep via the Apple menu, your callback will never receive the kIOMessageCanSystemSleep message. There is no way to prevent non-idle sleeps.
That's ok, I'll take what I can get. :) 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?
That said, yes, this code should work in 10.3.9, 10.4.8, and 9A303. I use it all the time.
* Are you getting any error returns from any of the IOKit or CF calls in main()?
No.
* Where are your breaks/printfs/asserts - are you breaking on the invocation of your callback function itself? Or only in the kIOMessageCanSystemSleep code (which will not get called on a force sleep)?
Right at the start of the callback (MySleepCallBack()).
Yep. I'm stumped.
I've put the project (and binary) here if anyone is interested. I've trivially modified it from what's on the page. I'm stumped too! <http://www.rogue-research.com/vtk/SleepTest.zip> -- ____________________________________________________________ Sean McBride, B. Eng sean@rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Sean McBride