Re: [AD] Disable screensaver

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


On 2008-11-06, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Thu, 2008-11-06 at 21:36 +1100, Peter Wang wrote:
> > > 
> > > 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.
> 
> Well, I can confirm that it does not work here in Gnome.
> 
> However, my current version of mplayer also does not have it working,
> but looking at google it seems it will be fixed in a future version
> using D-Bus (
> http://bugs.archlinux.org/task/5371
> ). I don't have time right now to add this to A5 though, and not sure if
> using D-Bus in A5 is a good idea.
> 
> Anyway, maybe someone can test it with KDE? If it doesn't work there as
> well, XResetScreenSaver() certainly seems worthless.

On further research (browsing mplayer mailing list archives) it seems
XResetScreenSaver() _is_ the right thing to do, but XScreenSaver,
gnome-screensaver, etc. are broken crap which don't respect the
standard.

I think we should not clutter the Allegro source with code paths to
support every non-standard screensaver program out there, especially if
they involve further dependencies.  But I realise there are a lot of
systems using these pieces of crap, so we can't just ignore them.

Instead, we could move all that junk into a shell script that Allegro
calls.  When al_inhibit_screensaver() is first called, we call the shell
script to detect which screensaver program is in use, which it returns
via the exit code.  Then, periodically, we'll call the shell script with
the detected screensaver program as an argument, whose job it is to do
the equivalent of XResetScreenSaver() for whatever piece of crap is
running.  If we detect no piece of crap running, we can just call
XResetScreenSaver().

Peter





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