DPMS and automatic sleep inhibit API

Rémi Denis-Courmont remi at remlab.net
Fri Feb 26 02:26:32 PST 2010


   Hello,

On Wed, 24 Feb 2010 00:06:18 +0100, Lubos Lunak <l.lunak at suse.cz> wrote:
> On Thursday 18 of February 2010, Ali Abdallah wrote:
>>     So why not having a standard API on a name
>> org.freedesktop.SessionManager with
>> two methods InhibitSleep
> 
>> InhibitDPMS
> 
>  XResetScreenSaver() . There's no need to reinvent that wheel.

There are several problems with that old API.

First, it can only reset, not inhibit/uninhibit. This might not be a
problem for a media player. It might just call XResetScreenSaver() every so
often. It won't require any extra timer ot CPU wakeup because it's playing
a movie anyway.
But at the other hand, how do you expect the power manager to be notified
of anything? As far as I can tell, it cannot, so it would have to poll all
the time. And that's a counter-productive to power saving.

Second, the inhibiting software needs to know the reset frequency. Either
it has to make a pessimistic (i.e. short timeout) guess, which is
inefficient. Or then it has to retrieved the value from the system. But
that introduces a bug if the value is modified after it was retrieved.


I would agree that X11 would be a more logical "carrier" for screen-saving
and DPMS signaling than D-Bus or shell commands (xdg-utils). But the
current X11 API is insufficient. Maybe you want to update the X11 spec and
implementation. Otherwise, yes there *is* a need to invent the wheel,
because the existing wheel is square-shaped.

-- 
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis



More information about the xdg mailing list