Re: "Kicking" the screensaver/display timers
Re: "Kicking" the screensaver/display timers
- Subject: Re: "Kicking" the screensaver/display timers
- From: Ethan Bold <email@hidden>
- Date: Mon, 21 Jul 2008 13:47:38 -0700
Please don't use UpdateSystemActivity(). It will work, but
IOPMAssertionCreateWithName()* is a better option.
- UpdateSystemActivity() is in the Carbon framework; using it may
cause you to unnecessarily link with this large & bulky framework,
affecting app launch times and memory usage.
- User's cant identify which process is keeping the display awake when
you call UpdateSystemActivity. If you use
IOPMAssertionCreateWithName(), OS X can keep track of which processes
are responsible (visible by running "pmset -g").
- You only have to create an assertion once to keep the display awake;
you need to call UpdateSystemActivity() once every 25-30 seconds to
cause a fake keyboard press. It's cleaner code for you.
Until now, UpdateSystemActivity() was the only game in town, but
please don't use it anymore! We've got a better alternative.
* Prefer IOPMAssertionCreateWithName(), which lets you pass a string
describing the purpose of the assertion (for debugging & diagnostic
use for Apple & yourself) over the vanilla IOPMASsertionCreate. If you
invoke IOPMAssertionCreate from multiple points in your code; naming
the assertions differently will help identify leaks.
-Ethan
On Jul 18, 2008, at 5:29 PM, Steve Checkoway wrote:
On Fri, Jul 18, 2008 at 05:24:45PM -0600, Shayne Wissler wrote:
I need an API call/approach for "kicking" the the
display-sleep/screensaver timers, as if the user had moved the mouse
or pressed a key. I need a program to be able to wake up the display
and/or stop the screensaver, without having the user interact with
the
mouse or keyboard. (E.g., for an app used in a classroom situation to
broadcast a message to a Mac hanging on a wall that happened to be in
sleep mode).
UpdateSystemActivity( IdleActivity );
--
Steve Checkoway
_______________________________________________
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
_______________________________________________
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