Preventing screensaver when playing movie?

Graeme Gill graeme2 at argyllcms.com
Tue Mar 4 15:42:24 PST 2008


Erik wrote:

> I sure hope not! It would leave the system in a broken state if mplayer 
> is killed before it reaches the point when it turns DPMS on again. No 
> application program should ever use commands like that. Only 

Nice in theory, but not all the screensaver API's support this approach.
To be able to follow that approach you need a light weight
(ie. calling it doesn't chew resources) programmatic means
of (ideally) holding the counter reset for a set period of time.

None of the various screen/power savers have such an API.
Some have a reset call, but you don't know how often you
have to call it. You just have to hope that the timeout is
longer than you need the display between each call to the reset.

DPMS doesn't have either, it's got:

  DPMSQueryExtension
  DPMSGetVersion
  DPMSCapable
  DPMSSetTimeouts
  DPMSGetTimeouts
  DPMSEnable
  DPMSDisable
  DPMSForceLevel
  DPMSInfo

None of those say they will reset the counter.

Now some of the other calls may reset DPMS as a side effect,
(XResetScreenSaver ?) but it doesn't seem to be documented.

The XScreenSaver extension doesn't have a reset either, it's
got a XScreenSaverSuspend(bool) (that does control DPMS as well),
that stops and starts it. If the the connection between client
and server breaks, the countdown continues though. So using
this won't allow the DPMS to start if you pause a movie etc.
(which may or may not be what the user actually wants), but
it does allow an application to disable things in a fail-safe
way.

Graeme Gill.



More information about the xorg mailing list