[evolution-data-server/gnome-3-38] alarm-notify: The XDG_CURRENT_DESKTOP env is a list



commit 313d6c3ce236ac541d6b4e183d36ae5107129f19
Author: Sebastien Bacher <seb128 ubuntu com>
Date:   Tue Jan 26 17:33:21 2021 +0100

    alarm-notify: The XDG_CURRENT_DESKTOP env is a list
    
    Related to https://gitlab.gnome.org/GNOME/evolution/-/merge_requests/75

 src/services/evolution-alarm-notify/e-alarm-notify.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/src/services/evolution-alarm-notify/e-alarm-notify.c 
b/src/services/evolution-alarm-notify/e-alarm-notify.c
index 1ba1eeb31..2e42671ee 100644
--- a/src/services/evolution-alarm-notify/e-alarm-notify.c
+++ b/src/services/evolution-alarm-notify/e-alarm-notify.c
@@ -234,7 +234,21 @@ e_alarm_notify_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]