[evolution-data-server] alarm-notify: The XDG_CURRENT_DESKTOP env is a list



commit 586abb30c5b3cdcf2240eaa16fd04dbb3f6e88a9
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 259f4c885..bf259d8af 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]