Allow the XDG_SESSION_TYPE to be set with an environment variable
diff --git a/src/core/main.c b/src/core/main.c
index 2a23c15..f6e8062 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -351,7 +351,9 @@ check_for_wayland_session_type (void)
   char *session_type = NULL;
   gboolean is_wayland = FALSE;
 
-  session_type = find_logind_session_type ();
+  session_type = g_strdup (g_getenv ("XDG_SESSION_TYPE"));
+  if (session_type == NULL)
+    session_type = find_logind_session_type ();
 
   if (session_type != NULL)
     {
