Preventing screensaver when playing movie?

Graeme Gill graeme2 at argyllcms.com
Wed Mar 5 15:19:08 PST 2008


Erik wrote:

> Nice in theory and absolutely necessary in practice. At least in a 
> multi-tasking environment, which is what X11 is designed to be.

You might regard it as so, but the authors of various screensavers
that are bundled with popular distributions aren't co-operating
with your wishes.

> If an application tampers with my display power-mangagement/privacy 
> settings on the sly like that, I surely let them know about it in a 
> sincere way.

You can't be surprised if applications achieve what is necessary
for their operation in whatever the best possible way is. If
the systems they have to work with don't do it nicely, then
they have no choice.

>>> but not all the screensaver API's support this approach.
>>>    

> We are talking about the X11 API here and it supports that approach.

No we're not, the discussion started in regard to all screensavers,
not just the ones that use the X11 API properly.

> The application should just call XResetScreensaver whenever it updates 
> the display with some content that the user may want to watch even 
> though he has not interacted with the system recently.

Great for those screensavers that are hooked into X11 properly.
What about the rest ?

>>> None of the various screen/power savers have such an API.

> That is not the point. What matters is that X11 has such an API. X11 
> applications should be written for X11, not for every single screensaver 
> out there. Then it is up to the user to chose an X11 compatible 
> screensaver if he wants a working system.

Meanwhile, back in the real world, we have to deal with what's actually
out there. The users of my application don't care who's fault it is,
they aren't interested being part of the "X11 purity crusade", they
would just like to know when I'm fixing my application. After all.
mplayer deals with the screensaver ok, why can't my app ?

> Simple. Every time the display is updated with something that the user 
> may want to see even though he has not interacted with the system recently.

Not so simple. My app needs the display long enough to do it's stuff
(take a measurement). It takes a certain amount of time. Without an
assurance that the screensaver won't kick in during that period,
it's an uncertain solution (although it will work when sane time-out
values are set in the system). So if you were designing the API to be
formally correct, you'd provide a time value with the reset, so my app
can say "don't start the screensaver/power saver in the next N seconds).

> DPMS on X11 is compatible with X11 so it works with XResetScreenSaver.

And XResetScreenSaver() doesn't have a hold time parameter.

> Some documentation for XResetScreenSaver would indeed not hurt. Maybe it 
> was just considered  too obvious what it should do? Note that reseting 
> DPMS is not a side effect. It is expected behaviour.

I would suspect that XResetScreenSaver() preceded DPMS,
but I would never be so rash as to assume that it has anything
to do with DPMS if it's not documented as such.

Graeme Gill.



More information about the xorg mailing list