[evolution] M!75 - The XDG_CURRENT_DESKTOP env is a list
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] M!75 - The XDG_CURRENT_DESKTOP env is a list
- Date: Wed, 27 Jan 2021 08:08:25 +0000 (UTC)
commit 7c628fb54e24a44081b878681389a310578d2c2e
Author: Sebastien Bacher <seb128 ubuntu com>
Date: Tue Jan 26 12:12:26 2021 +0100
M!75 - The XDG_CURRENT_DESKTOP env is a list
Closes https://gitlab.gnome.org/GNOME/evolution/-/merge_requests/75
src/e-util/e-misc-utils.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
index 5efdfb6c2b..d41edb8abd 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -3455,7 +3455,21 @@ e_util_is_running_gnome (void)
static gint runs_gnome = -1;
if (runs_gnome == -1) {
- runs_gnome = g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "GNOME") == 0 ? 1 : 0;
+ const gchar *desktop;
+ desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+ runs_gnome = 0;
+ if (desktop != NULL) {
+ gint ii;
+ gchar **desktops = g_strsplit (desktop, ":", -1);
+ for (ii = 0; desktops[ii]; ii++) {
+ if (!g_ascii_strcasecmp (desktops[ii], "gnome")) {
+ runs_gnome = 1;
+ break;
+ }
+ }
+ g_strfreev (desktops);
+ }
+
if (runs_gnome) {
GDesktopAppInfo *app_info;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]