Preventing screensaver when playing movie?

Lubos Lunak l.lunak at suse.cz
Thu Mar 6 06:36:56 PST 2008


On Thursday 06 of March 2008, Graeme Gill wrote:
> Erik wrote:
> > 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.

 Not correct, see below.

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

 They're broken? You can of course add workarounds if you consider them 
important enough ... but ... what is this discussion about right now? The 
original problem's been solved, it's been concluded that some screensavers 
are broken and need workarounds, so what's missing now?

> > 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).

 Given that XResetScreenSaver should cost next to nothing, and whatever it is 
that applications does that needs to remain visibile, it should be perfectly 
fine to call XResetScreenSaver once per every 10 seconds. It's not going to 
drain your laptop power any faster.

> 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).

 API that's formally correct? I don't think that exists in practice, at least 
not together with API that's usable (not to mention that in this specific case 
you usually don't know what N is, so there goes your perfect API designing). 
XResetScreenSaver() works and is good enough, what do you want more?

> > 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.

 If I'm not mistaken, X11 extensions are written in a way to care about 
backwards compatibility and they even into core functionality if necessary.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz



More information about the xorg mailing list