diff --git a/capplet/gsp-app.c b/capplet/gsp-app.c
index f0767aa..a59b3e5 100644
--- a/capplet/gsp-app.c
+++ b/capplet/gsp-app.c
@@ -557,7 +557,8 @@ gsp_app_get_can_launch (GspApp *app)
         g_return_val_if_fail (GSP_IS_APP (app), FALSE);
 
         return !app->priv->eggfile ||
-               egg_desktop_file_can_launch (app->priv->eggfile, "GNOME");
+               egg_desktop_file_can_launch (app->priv->eggfile,
+                                            gsm_util_get_current_desktop ());
 }
 
 gboolean
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 9d8c117..5443c44 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -108,6 +108,7 @@ static gboolean
 is_disabled (GsmApp *app)
 {
         GsmAutostartAppPrivate *priv;
+        const char *current_desktop;
 
         priv = GSM_AUTOSTART_APP (app)->priv;
 
@@ -130,9 +131,14 @@ is_disabled (GsmApp *app)
         }
 
         /* Check OnlyShowIn/NotShowIn/TryExec */
-        if (!egg_desktop_file_can_launch (priv->desktop_file, "GNOME")) {
-                g_debug ("app %s not installed or not for GNOME",
-                         gsm_app_peek_id (app));
+        current_desktop = gsm_util_get_current_desktop ();
+        if (!egg_desktop_file_can_launch (priv->desktop_file, current_desktop)) {
+                if (current_desktop) {
+                        g_debug ("app %s not installed or not for %s",
+                                 gsm_app_peek_id (app), current_desktop);
+                } else {
+                        g_debug ("app %s not installed", gsm_app_peek_id (app));
+                }
                 return TRUE;
         }
 
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
index faad668..4809471 100644
--- a/gnome-session/gsm-util.c
+++ b/gnome-session/gsm-util.c
@@ -182,6 +182,19 @@ gsm_util_get_saved_session_dir (void)
         return _saved_session_dir;
 }
 
+const char *
+gsm_util_get_current_desktop ()
+{
+        const char *desktop;
+
+        desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+        if (!desktop)
+                desktop = "GNOME"; /* backwards compatibility */
+        else if (desktop[0] == 0)
+                desktop = NULL; /* no desktop defined */
+
+        return desktop;
+}
 
 char **
 gsm_util_get_autostart_dirs ()
diff --git a/gnome-session/gsm-util.h b/gnome-session/gsm-util.h
index de1bd6a..8b13935 100644
--- a/gnome-session/gsm-util.h
+++ b/gnome-session/gsm-util.h
@@ -35,6 +35,8 @@ gchar      *gsm_util_get_empty_tmp_session_dir      (void);
 
 const char *gsm_util_get_saved_session_dir          (void);
 
+const char *gsm_util_get_current_desktop            (void);
+
 gchar**     gsm_util_get_app_dirs                   (void);
 
 gchar**     gsm_util_get_autostart_dirs             (void);
