Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 024ca186189a1c5e5353ff0a3710610c > files > 3

gnome-power-manager-2.24.0-3mdv2009.0.src.rpm

--- src/gpm-main.c.powerpolicy	2007-07-24 22:24:55.000000000 +0200
+++ src/gpm-main.c	2007-08-02 14:41:21.000000000 +0200
@@ -144,6 +144,7 @@
 	GError *error = NULL;
 	GOptionContext *context;
  	GnomeProgram *program;
+	gint ret;
 
 	const GOptionEntry options[] = {
 		{ "no-daemon", '\0', 0, G_OPTION_ARG_NONE, &no_daemon,
@@ -243,6 +244,20 @@
 
 	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:
+		egg_debug("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) {