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
Created attachment 906 Patch to implement the functionality
Sorry, not Terminal but 'xfce4-session' (Cannot change this because this would require to change the "target milestone" which I'm not allowed :)
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.
(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?
*** Bug 2034 has been marked as a duplicate of this bug. ***
Here's an updated version of this patch that applies against SVN head.
Created attachment 1936 Updates suspend/hibrenate patch.
(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.