[haiku] Re: Blueprint: User idle time component/interface for Haiku OS

On Tue, Dec 15, 2009 at 3:28 AM, Truls Becken <truls.becken@xxxxxxxxx> wrote:
> There was a discussion about power management on the development list
> a year ago:
>
> http://www.freelists.org/post/haiku-development/Disable-screensaver

As shown in my messages on that thread I also have an interest in this
and I think it can be done pretty simply. The basic use case is if the
user has been idle for a while then applications with interest in that
should be notified. Those applications can then have a choice as to
whether the screen saver and other power saving features are
activated. Movie players would say no, IM clients wouldn't really care
beyond setting the person idle, and most other applications wouldn't
care at all.

> As shown in his pseudocode, it would be nice if applications could
> register callbacks to be fired on specific idle times.

I think the BeOS/Haiku way to do this would be to have some sort of
"idle watcher" API which applications can subscribe to. This can send
messages when the user is idle (with an idle time in the message) as
well as messages when certain power management features are going to
be turned on, with the ability to cancel them. There could probably
also be a simple C function call which can return the exact idle time.
I think that should cover all the needs of the original poster, just
in a slightly different way.

-- 
Regards,
Ryan

Other related posts: