Provide support for user-triggered suspend/hibernate

Bug #11670 reported by Matthew Garrett
14
Affects Status Importance Assigned to Milestone
gnome-session (Ubuntu)
Fix Released
Medium
Sebastien Bacher

Bug Description

The logout menu should provide support for suspend and/or hibernation. This
requires us to settle on the provided interface, so blocks on acpi-support
gaining a full set of scripts.

Revision history for this message
Sebastien Bacher (seb128) wrote :

is that different of #3218 ?

Revision history for this message
Matthew Garrett (mjg59) wrote :

Hmm. Slightly, but they can probably be merged.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hum, right. We can keep this one for the scripts and #3218 for the UI changes.

Revision history for this message
Matthew Garrett (mjg59) wrote :

Ok. Suspend to disk should be triggered by calling:

/etc/acpi/hibernate.sh

Suspend to RAM should be triggered by calling:

/etc/acpi/sleep.sh

This is x86 and amd64 specific - PPC needs a different path.

It would be nice to be able to disable options if they're not switched on, but
that probably makes things more complicated. /etc/default/acpi-support will have

ACPI_SLEEP=true

if suspond to RAM is enabled, and

ACPI_HIBERNATE=true

if suspend to disk is enabled.

Revision history for this message
Sebastien Bacher (seb128) wrote :

status update

Now we have /usr/sbin/pmi, we can query it for hibernate or sleep and run the
corresponding action.

For the frontend part gnome-session is easy to change to add the options to the
list of actions, but using gdmflexiserver is not easy as expected.
gdmflexiserver gives a command to gdm, which is runned when you get back to gdm
... but we don't want to get back to gdm here. Changing that doesn't seems
really easy (I've sent a mail to the gdm upstream maintainer about this, waiting
for a reply). We can also use gksudo here, but having to enter a password is not
really nice.

Cc: thom since he's working on this too.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ccing Jeff and Matt too. Jeff, the default gdm theme has no suspend action
apparently.

Revision history for this message
Jeff Waugh (jdub) wrote :

Thanks Seb, I've filed that as #6903 on ubuntu-artwork.

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've updated gdm and gnome-session for the powermanagement features today.
Please let me know how that works for you. The current session dialog is not
really nice with the new labels, perhaps we should put a second title for the
powermanagement stuff ?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #8)
> I've updated gdm and gnome-session for the powermanagement features today.
> Please let me know how that works for you. The current session dialog is not
> really nice with the new labels, perhaps we should put a second title for the
> powermanagement stuff ?

Works perfectly for me. I agree that the dialog should be cleaned up, since the
list is now too long. Perhaps divide it up as you suggest, and perhaps reorder
the list as well. Jeff, what do you think?

Revision history for this message
Jeff Waugh (jdub) wrote :

I have to say, the Windows XP "Turn Off Computer" dialogue does really well
here. It has three buttons: Suspend, Reboot, Shutdown. If you hold shift over
Suspend, it changes to Hibernate. But there's no radio button damage, the
strings are short, and the button icons are great. Here's a screenshot:

http://www.helpwithpcs.com/courses/windows-xp-tutorial/shutdown%20menu.jpg

I think this is a much better option to the "add more items to the System menu"
solution. Windows distinguishes between "Log Out user" and "Turn Off Computer",
the "Log OUt" dialogue has "Switch User" and "Log Out". For now, I wouldn't mind
conflating these two to have a four-button dialogue (with the save session
clicky, gar):

"Log Out" (door icon?)
"Stand By" (stupid variation on international sign for turn me off)
"Turn Off" (international sign for turn me off)
"Restart" (blinky)

Revision history for this message
Sebastien Bacher (seb128) wrote :

The idea is nice but I'm not sure we should do that for hoary. Even with some
good icons we probably wants to keep a label, right ? The current labels are
pretty wides and doesn't look good for that and changing the label would mean
dropping the translations. Opinions on this ?

Revision history for this message
Jeff Waugh (jdub) wrote :

The sooner we do it, the better off our translations will be. Remember that we
will be doing translation updates through the new language pack infrastructure,
so this won't be as bad as it seems. :-)

Revision history for this message
Matt Zimmerman (mdz) wrote :

I don't like hiding suspend-to-RAM behind "Shift".

Since we disable suspend-to-RAM by default anyway, I'm not fussed about the GUI
for it; people who are enabling it know what they're getting into, and can cope
with an extra radio button in the dialog.

As far as I'm concerned, this is good to go for 5.04.

Revision history for this message
Jeff Waugh (jdub) wrote :

Hibernate is suspend-to-disk, not suspend-to-ram. So by default, you'd see
Hibernate. If suspend is enabled, you'd see Suspend, with Hibernate appearing on
shift-modifier.

Revision history for this message
Sebastien Bacher (seb128) wrote :

closing this bug since the issue is fixed with hoary. Feel free to open an
another bug about the cosmetic changes to do

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.