aboutsummaryrefslogtreecommitdiff
path: root/src/backend-dbus
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-07-10 00:30:45 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-07-10 00:30:45 -0500
commitf71bc96e3131f4241256a850ab8c0b556bdac4dd (patch)
treecbad9c5408d4b689a05342592b96fea5961cd296 /src/backend-dbus
parent4168038976915aea6f73449f145d923cc63bd1be (diff)
downloadayatana-indicator-session-f71bc96e3131f4241256a850ab8c0b556bdac4dd.tar.gz
ayatana-indicator-session-f71bc96e3131f4241256a850ab8c0b556bdac4dd.tar.bz2
ayatana-indicator-session-f71bc96e3131f4241256a850ab8c0b556bdac4dd.zip
just to be safe, check to see that g_getenv('XDG_SEAT') passes too
Diffstat (limited to 'src/backend-dbus')
-rw-r--r--src/backend-dbus/utils.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backend-dbus/utils.c b/src/backend-dbus/utils.c
index d1511f4..bc862e8 100644
--- a/src/backend-dbus/utils.c
+++ b/src/backend-dbus/utils.c
@@ -126,8 +126,7 @@ indicator_session_util_get_session_proxies (
gpointer user_data)
{
struct session_proxy_data * data;
- char * login1_seat_path;
- const char * dm_seat_path;
+ const char * str;
data = g_new0 (struct session_proxy_data, 1);
data->callback = func;
@@ -144,15 +143,20 @@ indicator_session_util_get_session_proxies (
on_login1_manager_ready, data);
/* login1 seat */
- login1_seat_path = g_strconcat ("/org/freedesktop/login1/seat/", g_getenv("XDG_SEAT"), NULL);
- login1_seat_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ if ((str = g_getenv ("XDG_SEAT")))
+ {
+ char * path;
+ data->pending++;
+ path = g_strconcat ("/org/freedesktop/login1/seat/", str, NULL);
+ login1_seat_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES,
"org.freedesktop.login1",
- login1_seat_path,
+ path,
data->cancellable,
on_login1_seat_ready,
data);
- g_free (login1_seat_path);
+ g_free (path);
+ }
/* Accounts */
data->pending++;
@@ -164,14 +168,14 @@ indicator_session_util_get_session_proxies (
on_accounts_proxy_ready, data);
/* DisplayManager seat */
- if ((dm_seat_path = g_getenv ("XDG_SEAT_PATH")))
+ if ((str = g_getenv ("XDG_SEAT_PATH")))
{
data->pending++;
display_manager_seat_proxy_new_for_bus (
G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES,
"org.freedesktop.DisplayManager",
- dm_seat_path,
+ str,
data->cancellable,
on_display_manager_seat_proxy_ready, data);
}