[haiku-development] Re: Disable screensaver?

  • From: "Ryan Leavengood" <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 2 Nov 2008 11:34:12 -0500

I watch a lot of videos on my laptop and Windows definitely disables
the screensaver when a video is on. Though I am not sure if it is for
any video or just for full screen as I generally watch full screen.
But Windows does not disable the screensaver for Flash videos in a
browser  (which I think would also be a nice feature.) Of course we
don't necessarily want to copy Windows, but it is good to know that
another OS does it.

Linux on the other hand does not seem to ever disable the screensaver,
at least when I use my favorite video player, mplayer. This of course
probably has to do with the general nature of Linux being cobbled
together from various technologies which generally don't interact well
together.

For games I would think again that Windows disables the screensaver
but Linux does not (which really only matters when a joystick is being
used I suppose.)

Of course with Haiku we can do things differently since the various
parts of the OS mesh well together.

I have thought about this before because of my annoyance with Linux
showing screensavers when I am watching a video, and I do not want
Haiku to do that too.

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.

Regards,
Ryan

Other related posts: