summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2015-03-22 18:40:55 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-03-23 12:40:17 +0200
commitc1f7d50f7ace6790169301d948b41efeb5ef63ca (patch)
tree0efda59246e3f16c560ef1a117a4ac1fb9e8ed17
parentcee86f6fc9325200a6ef6a7ed3299c60e91c1c48 (diff)
downloadnautilus-c1f7d50f7ace6790169301d948b41efeb5ef63ca.tar.gz
desktop-canvas-view: Support multiple desktop names in XDG_CURRENT_DESKTOP
https://bugzilla.gnome.org/show_bug.cgi?id=746607
-rw-r--r--src/nautilus-desktop-canvas-view.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index fec4b4896..6890743ce 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -493,13 +493,32 @@ get_control_center_command (const gchar ** params_out)
gchar *path;
const gchar *retval;
const gchar *params;
+ const gchar *xdg_current_desktop;
+ gchar **desktop_names;
+ gboolean is_unity;
+ int i;
path = NULL;
retval = NULL;
params = NULL;
+ xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+
+ /* Detect the Unity-based environments */
+ is_unity = FALSE;
+ 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;
+ break;
+ }
+ }
+ g_strfreev (desktop_names);
+ }
+
/* In Unity look for unity-control-center */
- if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
+ if (is_unity) {
path = g_find_program_in_path ("unity-control-center");
if (path != NULL) {
retval = "unity-control-center";