Inhibit and ForceInhibit

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.

Published by


Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

One thought on “Inhibit and ForceInhibit”

  1. One thing that could help solve that bug would be to allow a dialog to pop up and explain why a (intentional?) action was inhibit. This dialog could provide options like “Cancel Suspend”, “Pause file transfer and continue to suspend” or “Make me a new coaster and stop burning now”

Comments are closed.