aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@ubuntu.com>2014-11-30 19:58:56 +0300
committerDmitry Shachnev <mitya57@ubuntu.com>2014-11-30 19:58:56 +0300
commit54c66e164afc1a96ed8e75c983c4abcb4cabc287 (patch)
tree1eb27e45f24d6e5bfb2ff6bad0ad17f812a84fd0
parent5f72c7af944bd1c16f5fce1de865c4ffa21f184a (diff)
downloadayatana-indicator-session-54c66e164afc1a96ed8e75c983c4abcb4cabc287.tar.gz
ayatana-indicator-session-54c66e164afc1a96ed8e75c983c4abcb4cabc287.tar.bz2
ayatana-indicator-session-54c66e164afc1a96ed8e75c983c4abcb4cabc287.zip
Support multiple names in XDG_CURRENT_DESKTOP.
-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");