Once upon a time there were three inhibit API’s:
- HAL: system-wide locks on suspend, hibernate and shutdown
- gnome-power-manager: session inhibit for idle suspend and hibernate
- gnome-screensaver: session inhibit for screen blanking and DPMS
Obviously, this has a few big flaws:
- An application might have to inhibit three services, using slightly different methods
- gnome-screensaver has to expose lots of low level icky stuff for g-p-m to consume
- We’ve got a screensaver doing idle detection
- We’ve got gnome-power-manager writing into gnome-screensaver GConf keys to get the timeouts correct
- It’s not possible to prevent logout or user switching
- The hand-off between the session and power manager is poorly defined, so we get stupid libnotify popups rather than nice dialogue integration.
- We don’t integrate with presence services, so we just ignore away/busy/idle status.
Basically, we need the session manager to take care of the all registrations and handle the interactions. Luckily, this is what Jon McCann has done in gnome-session.
These new interfaces are session management done right. Of course, this breaks the old world order of inhibiting gnome-power-manager and gnome-screensaver. For the 2-26 series all inhibits are proxied by g-p-m and g-s to gnome-session, so everything should pretty much just work like before. But, early in the 2-27 cycle we’re going to remove this compat code and everything will have to go through gnome-session. For most code it’ll just be a couple of lines changed and behind the scenes it’s a much simpler and more powerful design.
Like some of the other changes we are making at the moment (DeviceKit, PulseAudio, KMS) this is a new way of doing things, and things might temporarily break. They’ll be regressions, but things can be fixed quickly and most importantly, correctly. What we were using before just wasn’t good enough. With this new framework, we can do it right for GNOME 3.0.