< Desktop | Whiteboards
Problem
The Inhibit pattern has proven to be quite successful. It is a good way for applications to proactively inform the system about actions that should not be taken.
Firstly, we offer too many ways to do this. We currently (as of GNOME 2.24) have the following:
* http://www.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html#gs-method-Inhibit * http://people.freedesktop.org/~hughsient/temp/dbus-interface.html#dbus-inhibit * http://www.gnome.org/~mccann/gnome-session/docs/gnome-session.html#org.gnome.SessionManager.Inhibit
Secondly, it is not always possible to know ahead of time if an action should be avoided. So, there is often a need for the [pattern]. This pattern has been partially implemented in gnome-session 2.24. See http://live.gnome.org/SessionManagement/GnomeSession .
Use Cases
Watching a movie on laptop screen
* Movie player should inhibit idleness
Close laptop lid: * Suspend
Watching a movie with laptop plugged into an external monitor/TV
* Movie player should inhibit idleness Close laptop lid: * Turn off laptop panel backlight * Do not suspend until after next idle period after movie finishes playing
Listening to music on laptop in another room
* Not sure about this one * Possibly Inhibit idleness
Burning a CD
* Perfectly fine to be idle and lock the screen if necessary * Inhibit suspend * Inhibit user switch (once we have frevoke) * Inhibit logout * Not necessary to inhibit reboot or shutdown since logout and switch are inhibited
Transferring files to a removable disk
* Same as Burning a CD
Performing a core system software update
* Only inhibit system reboot/shutdown?
Performing an application software update
* Only inhibit system reboot/shutdown? * Maybe even fail and try again
Editing a document
* Only inhibit logout
Playing a game
* Inhibit idleness
Discussion
Overview of actions
Action | Interface |
---|---|
Session idleness | org.gnome.ScreenSaver.Inhibit |
Automatic screen locking | org.gnome.ScreenSaver.Inhibit |
Switching users | org.gnome.SessionManager.Inhibit |
Automatic suspend | org.freedesktop.PowerManagement.Inhibit |
Automatic hibernation | org.freedesktop.PowerManagement.Inhibit |
Logout | org.gnome.SessionManager.Inhibit |
Reboot/Shutdown | TBD |
References
* http://bugzilla.gnome.org/show_bug.cgi?id=334809#c6