[haiku-development] Re: Disable screensaver?

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 02 Nov 2008 18:32:15 +0100

Ryan Leavengood wrote:
> I think in general what Stephan described is good, though I would suggest 
> we keep it as simple as possible:
> 1. As part of their app flags (or whatever else would be easily
> queryable) each application that cares about power management events can 
> indicate it wants to be notified about power management changes.
> 2. When a power management event occurs (turn screensaver on, turn
> harddrive off, put machine to sleep), each of those applications can be 
> sent messages indicating the new event. If any respond negatively, the 
> event is canceled.
> This live querying is better because some applications may have different 
> situations when they want to cancel an event or not. When a media player 
> is playing a video it would want to cancel the screensaver, but if it is 
> paused it doesn't care. Same with a BitTorrent application that might 
> have no active downloads or maybe has finished all downloads and seeded 
> to a user specified "seeding is done ratio."
> Of course the BitTorrent application would not care about the screensaver 
> but only the harddrive and sleep mode events.
> All the above would still require some sort of power management framework 
> though, but I think Haiku needs that either way. I think the above could 
> be prototyped with the screensaver though.

The live message and reply idea is much better than what I had in mind. My 
approach would have involved housekeeping, while your idea does not need 
it. Suppose an application like the MediaPlayer disables the screensaver, 
but then crashes before it has a chance to disable it again... the service 
that manages the events would have to keep track of which application has 
set which setting... your approach is much more robust. Nice!

Best regards,

Other related posts: