Re: slow NSWorkspaceDidWakeNotification
Re: slow NSWorkspaceDidWakeNotification
- Subject: Re: slow NSWorkspaceDidWakeNotification
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Fri, 18 Mar 2005 13:55:34 +0700
On 17.03.2005, at 10:02, Shaun Wexler wrote:
On Mar 16, 2005, at 6:19 AM, Gerriet M. Denkmann wrote:
When I put the computer to sleep (via the Apple-menu) I get after 1
seccond the message "kIOMessageSystemWillSleep", but then it takes 30
seconds until the computer really starts sleeping. This is not very
nice.
2. Why is there the 30 seconds delay between
kIOMessageSystemWillSleep and the actual sleep?
What can I do to avoid this?
Inside the power-event notification callback, you need to call:
IOAllowPowerChange(root_power_service, (long)messageArgument);
...otherwise the 30-second delay is the default behavior.
Thank you very much - with this addition everything works fine.
Three more questions though:
1. The system clock seems to be working 50 - 60 milliseconds after
kIOMessageSystemWillPowerOn.
So I do:
[ self performSelector: @selector(updateClock) withObject: nil
afterDelay: 0.5 ];
This seems to be working, but somehow looks like a bad hack.
Is there something like a
"NSSystemClockIsNowInAUsableStateNotification" ? Or is there some
better way?
2. Between kIOMessageSystemWillPowerOn and kIOMessageSystemHasPoweredOn
is a delay of 7 seconds (iBook G4). What is the system doing in this
rather long period?
Just beeing curious.
3. Is there any documentation which would explain that one has to call
IOAllowPowerChange() or how to call CFRunLoopAddSource() ?
The only documentation I have found is: /Developer/ADC Reference
Library/documentation/Darwin/Reference/IOKit/IOPMLib/index.html
Kind regards
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden