aboutsummaryrefslogtreecommitdiff
path: root/src/users-service-dbus.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-09-27 10:42:21 -0500
committerTed Gould <ted@gould.cx>2011-09-27 10:42:21 -0500
commitde44ede6a0c9e6ba1046e82bdb7d878a9ad13a08 (patch)
tree8a64a27dfe93a0e59cb0e2208d42ad79f72bcb56 /src/users-service-dbus.c
parentb1892b936fbaded8f025e5da6d1a8e40e2bb0cb4 (diff)
parentc28ee7f7396fbb1abb6cddd96289e7d8e9d19db4 (diff)
downloadayatana-indicator-session-de44ede6a0c9e6ba1046e82bdb7d878a9ad13a08.tar.gz
ayatana-indicator-session-de44ede6a0c9e6ba1046e82bdb7d878a9ad13a08.tar.bz2
ayatana-indicator-session-de44ede6a0c9e6ba1046e82bdb7d878a9ad13a08.zip
Switch to using the XDG_SEAT_PATH env. variable instead of using DBus
Diffstat (limited to 'src/users-service-dbus.c')
-rw-r--r--src/users-service-dbus.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 0bab8c8..971b854 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -203,40 +203,10 @@ static void
create_display_manager_proxy (UsersServiceDbus *self)
{
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- DBusGProxy *dm_proxy = NULL;
GError *error = NULL;
- const gchar *cookie = NULL;
- gchar *seat = NULL;
+ const gchar *seat = NULL;
- cookie = g_getenv ("XDG_SESSION_COOKIE");
- if (cookie == NULL || cookie[0] == 0)
- {
- g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
- return;
- }
-
- dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
- "org.freedesktop.DisplayManager",
- "/org/freedesktop/DisplayManager",
- "org.freedesktop.DisplayManager");
-
- if (!dm_proxy)
- {
- g_warning ("Failed to get DisplayManager proxy.");
- return;
- }
-
- /* Now request the proper seat */
- if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
- G_TYPE_STRING, cookie, G_TYPE_INVALID,
- DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
- {
- g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
- g_object_unref (dm_proxy);
- g_error_free (error);
- return;
- }
- g_object_unref (dm_proxy);
+ seat = g_getenv ("XDG_SEAT_PATH");
g_debug ("CREATING DM PROXIES WITH %s", seat);
priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
"org.freedesktop.DisplayManager",
@@ -249,8 +219,6 @@ create_display_manager_proxy (UsersServiceDbus *self)
"org.freedesktop.DBus.Properties");
- g_free (seat);
-
if (!priv->display_manager_proxy)
{
g_warning ("Failed to get DisplayManager seat proxy.");