Fixes LP #321384 - Should now hide the window and use a try/catch to

send the dbus message and quit correctly.
This commit is contained in:
2009-01-26 20:39:56 +00:00
parent 648b5e23fc
commit 8ffe6e4ce3

View File

@@ -338,15 +338,27 @@ class OpenboxLogout():
elif (data == 'shutdown'):
self.dbus_powermanagement.Shutdown()
elif (data == 'suspend'):
self.window.hide()
os.system('gnome-screensaver-command -l')
self.dbus_powermanagement.Suspend(0)
try:
self.dbus_powermanagement.Suspend(0)
except:
pass
self.quit()
elif (data == 'hibernate'):
self.window.hide()
os.system('gnome-screensaver-command -l')
self.dbus_powermanagement.Hiberate()
try:
self.dbus_powermanagement.Hiberate()
except:
pass
self.quit()
elif (data == 'safesuspend'):
self.dbus_powermanagement.SuspendHybrid(0)
self.window.hide()
try:
self.dbus_powermanagement.SuspendHybrid(0)
except:
pass
self.quit()
elif (data == 'lock'):
os.system('gnome-screensaver-command -l')