Re: Moving DPMS to gnome-power-manager



Hey Richard,

Richard Hughes wrote:
On Thu, 2006-01-05 at 12:27 -0500, William Jon McCann wrote:
I'm thinking that we make the following changes:

1. Move the GConf keys and policy management to gnome-power-manager

Sure, good for me. I guess you mean the dpms_* keys currently in g-s.

Yup.

2. Instead of activating display power management when the screensaver starts, gnome-power-manager can activate it when the session goes idle (in response to SessionIdleChanged). This will allow it to work even when the screensaver is disabled.

Yup, also okay.

3. Probably still need to do manually turn on the display when we get "poked". Or alternately, we can use a g-p-m D-Bus method to turn the display power on.

DBUS method is good for me.

4. Maybe the best thing is for g-p-m to emit a signal when the display power is changed. g-s could then just watch for that.

So, we need a DPMS API for g-p-m:

typedef enum {
        POWER_MODE_ON,
        POWER_MODE_STANDBY,
        POWER_MODE_SUSPEND,
        POWER_MODE_OFF
} PowerMode;

void DpmsPowerSet (int PowerMode)
int DpmsPowerGet (void)

Or should we break out these individually like:

void DpmsPowerSetModeOn (bool);
bool DpmsPowerGetModeOn (void);

And presumably emit:

DbusStateChanged

I'm not a D-Bus expert/insider so there may be a better convention, but how about:

Methods:
void  setDpmsMode (const char *mode_string)
char *getDpmsMode (void)

Signals:
DpmsModeChanged (const char *mode_string)

where mode_string is one of: "on", "standby", "suspend", "off".

Incidentally, what is the practical difference between
GS_POWER_MODE_STANDBY and GS_POWER_MODE_SUSPEND?

This says there is a difference:
http://en.wikipedia.org/wiki/VESA_Display_Power_Management_Signaling

In practice I'm not sure most hardware follows that but we should probably respect the standard.

Sure -- do you feel confident hacking on the g-p-m codebase, or do you
want me to implement this? I definitely need help with the API design.

I think we can copy and paste a good deal of this.  I'll take a stab at it.

Jon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]