diff -uprN gnome-settings-daemon-2.24.0-orig/plugins/media-keys/gsd-media-keys-manager.c gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-manager.c
--- gnome-settings-daemon-2.24.0-orig/plugins/media-keys/gsd-media-keys-manager.c	2008-11-06 17:23:08.986060511 +0800
+++ gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-manager.c	2008-11-06 17:25:12.833597770 +0800
@@ -231,15 +231,34 @@ execute (GsdMediaKeysManager *manager,
 }
 
 static void
-do_sleep_action (char *cmd1,
-                 char *cmd2)
+do_sleep_action ()
 {
-        if (g_spawn_command_line_async (cmd1, NULL) == FALSE) {
-                if (g_spawn_command_line_async (cmd2, NULL) == FALSE) {
-                        acme_error (_("Couldn't put the machine to sleep.\n"
-                                        "Verify that the machine is correctly configured."));
+        GError *error = NULL;
+        DBusGConnection *connection;
+        DBusGProxy *proxy;
+        gboolean ret = FALSE;
+	
+        connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+        if (connection == NULL) {
+                if (error) {
+                        g_warning ("Couldn't connect to session message bus %s", error->message);
+                        g_error_free (error);
                 }
+                return;
+        }
+
+        proxy = dbus_g_proxy_new_for_name (connection,
+                                     "org.gnome.SessionManager",
+                                     "/org/gnome/SessionManager",
+                                     "org.gnome.SessionManager");
+        ret = dbus_g_proxy_call (proxy, "Shutdown", &error,
+                                 G_TYPE_INVALID,
+                                 G_TYPE_INVALID);
+        if (!ret) {
+                        g_warning ("ERROR calling gnome-session shutdown D-Bus method: %s", error->message);
+                        g_error_free (error);
         }
+        g_object_unref (proxy);
 }
 
 static void
@@ -785,7 +804,7 @@ do_action (GsdMediaKeysManager *manager,
                 do_mail_action (manager);
                 break;
         case SLEEP_KEY:
-                do_sleep_action ("apm", "xset dpms force off");
+                do_sleep_action ();
                 break;
         case SCREENSAVER_KEY:
                 if ((cmd = g_find_program_in_path ("gnome-screensaver-command"))) {
