aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@ubuntu.com>2015-02-28 18:10:53 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-02-28 18:10:53 +0000
commite3c5a5b9a89cc577f772a588778a41428728677d (patch)
tree1eb27e45f24d6e5bfb2ff6bad0ad17f812a84fd0
parent5f72c7af944bd1c16f5fce1de865c4ffa21f184a (diff)
parent54c66e164afc1a96ed8e75c983c4abcb4cabc287 (diff)
downloadayatana-indicator-session-e3c5a5b9a89cc577f772a588778a41428728677d.tar.gz
ayatana-indicator-session-e3c5a5b9a89cc577f772a588778a41428728677d.tar.bz2
ayatana-indicator-session-e3c5a5b9a89cc577f772a588778a41428728677d.zip
Support multiple desktop names in XDG_CURRENT_DESKTOP.
Approved by: Charles Kerr, Alberts Muktupāvels
-rw-r--r--src/backend-dbus/actions.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index 8bee0df..10be837 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -831,9 +831,25 @@ static gboolean
have_unity_control_center (void)
{
gchar *path;
+ const gchar *xdg_current_desktop;
+ gchar **desktop_names;
gboolean have_ucc;
+ gboolean is_unity;
+ int i;
+
+ is_unity = FALSE;
+ xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+ if (xdg_current_desktop != NULL) {
+ desktop_names = g_strsplit (xdg_current_desktop, ":", 0);
+ for (i = 0; desktop_names[i]; ++i) {
+ if (!g_strcmp0 (desktop_names[i], "Unity")) {
+ is_unity = TRUE;
+ }
+ }
+ g_strfreev (desktop_names);
+ }
- if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") != 0)
+ if (!is_unity)
return FALSE;
path = g_find_program_in_path ("unity-control-center");