Re: [AD] Disable screensaver

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


On 2008-11-02, Stepan Roh <stepan@xxxxxxxxxx> wrote:
> 
> On Fri, 31 Oct 2008, Evert Glebbeek wrote:
> 
> > 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.
> 
> What about 
> http://portland.freedesktop.org/xdg-utils-1.0/xdg-screensaver.html ?

Unfortunately it doesn't seem to do anything for the native X
screensaver system, which is the only one I actually care about
(anything other than blanking the screen is stupid).

I made the X port call XResetScreenSaver() every 10 seconds, which seems
to do the trick.  I don't really know what the effect of that function
call is, as the man page says, and I'm quoting the whole thing here:

    The XResetScreenSaver function resets the screen saver.

Nice.

Peter





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