I've been looking at the gnome-power-manager Inhibit API. So far we basically have this:
Inhibit – to get a cookie to prevent suspending
UnInhibit – clear the cookie and allow suspending
Having an active cookie stops the auto-suspend feature when you are copying files over a slow network link, and also stops you from pressing the off button on your computer half the way through burning a DVD.
The distinction between the two need to be clearer, and I think I need new method names to solve things like bug 402863.
The new method names needs to differentiate between “I'm in the middle of an RPM transaction don't suspend even if the user pressed the suspend button” and “I'm playing music, don't auto-suspend if all the sessions go idle”.
So ideas welcome. I'm erring so far to Inhibit() for inactive sleep and ForceInhibit() for the RPM transaction case, but I'm not sure that's particularly intuitive. Ideas welcome. Thanks.