Re: [AD] Disable screensaver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 31 Oct 2008, at 04:36, Peter Wang wrote:
On 2008-10-30, Trent Gamblin <trent@xxxxxxxxxx> wrote:
Since most fullscreen games these days disable the screensaver, and
I need to do so for my game since joystick input does not keep the
screensaver from being activated, I thought it would be a good
addition to A5 to have a cross platform way to do it.

Agreed.

Seconded. It's such an obviously useful feature to have that I'm not sure why no one mentioned it before. :)

I think it should query.  "Don't know" is a valid response.

I agree with this as well.

Do we restore the original setting when Allegro exits, or expect the
user to do it?

Have Allegro do it on exit, or you'll get confused users who forget to do it, or even worse, it gets switched off as a result of a program crash.

As for implementing it, I looked into this once for Linux for one of my games that is almost completely controlled by the gamepad - which didn't prevent the screensaver from taking over the screen. I think first of all it depends on which screensaver is used (xscreensaver, kscreensaver, others?). Secondly for the one I looked into, the way to disable it seemed to be sending repeated messages to the screensaver through its message system (I got this from looking at the source for mplayer). I suppose this can be done from a background thread but it sounds rather annoying. On the other hand, it means we don't need to worry about restoring the screensaver afterwards. Of course, we can always document which screensavers we know how to disable and say we accept fixes for others.

I don't know about OS X or Windows (I can look into OS X for this), but I imagine it being a bit simpler there in the sense that there is probably just one standard screensaver to worry about.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/