! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Support "hibernate" and "suspend" in logout dialog
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-session
Component:
General

Comments

Description Bernhard Walle 2006-12-18 23:35:02 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1) Gecko/20061023 SUSE/2.0-31 Firefox/2.0
Build Identifier: 

XUbuntu added a patch that has a 'hibernate' and a 'suspend' button in the logout dialog. I also added this patch (well, I needed to adapt) in my SUSE packages in the BuildService. My patch is attached. Maybe it's worth adding this feature in SVN.

Reproducible: Always
Comment 1 Bernhard Walle 2006-12-18 23:35:30 CET
Created attachment 906 
Patch to implement the functionality
Comment 2 Bernhard Walle 2006-12-18 23:37:43 CET
Sorry, not Terminal but 'xfce4-session' (Cannot change this because this would require to change the "target milestone" which I'm not allowed :)
Comment 3 Benedikt Meurer editbugs 2006-12-21 21:54:40 CET
With your patch, D-Bus is no longer optional, which is not inline with the policy for 4.4. Btw. there was already another bug report for xfce4-session and power management. For some reason I cannot find it right now.
Comment 4 Sebastian Krämer 2007-08-22 19:08:23 CEST
(In reply to comment #3)
>Btw. there was already another bug report for xfce4-session and
> power management. For some reason I cannot find it right now.

I guess that was Bug #2034 (Add "Hibernate" Option to End session menu). Duplicate?
Comment 5 Brian J. Tarricone (not reading bugmail) 2008-10-23 21:53:55 CEST
*** Bug 2034 has been marked as a duplicate of this bug. ***
Comment 6 Michael Casadevall 2008-10-31 18:30:38 CET
Here's an updated version of this patch that applies against SVN head.
Comment 7 Michael Casadevall 2008-10-31 18:31:04 CET
Created attachment 1936 
Updates suspend/hibrenate patch.
Comment 8 Brian J. Tarricone (not reading bugmail) 2008-11-01 10:08:32 CET
(In reply to comment #7)
> Created an attachment (id=1936) [details]
> Updates suspend/hibrenate patch.

This is unfortunately nowhere near as feature-complete as I wanted.  It's notably missing checks for the HAL properties 'power_management.can_hibernate' and 'power_management.can_suspend'.  I don't really have the time to add this right now.  Maybe as a bug-fix later.

It also handles shutdown incorrectly in xfsm_manager_save_yourself_global(), in that it only tries to suspend or hibernate if the user selects it from the dialog.  If the user initiates these commands over xfce4-session's dbus interface (or via the xfce4-session-logout command), it'll just shut the system down (well, actually, it'll act as if it's a shutdown, but then have no idea what to do at the end and just quit).  Fixed that.

I also don't like how the HAL check has leaked into xfsm_manager_save_yourself_global(), so I got rid of that; the shutdown helper handled that transparently.

Looking at this more closely I'm really just not happy with how shutdown/logout is handled in general (not just in the patch, but in xfce4-session overall), but this isn't really the time to change this.

There's also a dearth of error reporting (again, in general, not a fault of this patch), so I added that as well.

Finally, there were a bunch of coding style inconsistencies; please try to pay attention to this in the future.

Usually I'd send the patch back for revision, but since we need it in the tree 2 days ago, I went ahead and finished it myself.  Thanks for doing the bulk of figuring out how all this should work, though; it did save me quite a lot of time.

Bug #2672

Reported by:
Bernhard Walle
Reported on: 2006-12-18
Last modified on: 2009-07-14
Duplicates (1):
  • 2034 Add "Hibernate" Option to End session menu

People

Assignee:
Benedikt Meurer
CC List:
3 users

Version

Attachments

Patch to implement the functionality (18.64 KB, patch)
2006-12-18 23:35 CET , Bernhard Walle
no flags
Updates suspend/hibrenate patch. (9.80 KB, patch)
2008-10-31 18:31 CET , Michael Casadevall
no flags

Additional information