File gnome-power-manager-system-policy.patch of Package gnome-power-manager
Index: src/gpm-main.c
===================================================================
--- src/gpm-main.c.orig
+++ src/gpm-main.c
@@ -145,6 +145,7 @@ main (int argc, char *argv[])
GError *error = NULL;
GOptionContext *context;
GnomeProgram *program;
+ gint ret;
const GOptionEntry options[] = {
{ "no-daemon", '\0', 0, G_OPTION_ARG_NONE, &no_daemon,
@@ -244,6 +245,20 @@ main (int argc, char *argv[])
loop = g_main_loop_new (NULL, FALSE);
+ ret = dbus_bus_request_name(dbus_g_connection_get_connection(system_connection),
+ "org.freedesktop.Policy.Power",
+ DBUS_NAME_FLAG_REPLACE_EXISTING, NULL);
+ switch (ret) {
+ case DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER:
+ egg_debug("Successfully acquired interface org.freedesktop.Policy.Power.");
+ break;
+ case DBUS_REQUEST_NAME_REPLY_IN_QUEUE:
+ printf("Queued for interface org.freedesktop.Policy.Power.");
+ break;
+ default:
+ break;
+ };
+
/* Only timeout and close the mainloop if we have specified it
* on the command line */
if (timed_exit == TRUE) {