summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-12-17 11:30:07 -0500
committerRay Strode <rstrode@redhat.com>2014-12-17 11:31:35 -0500
commit2a3e3e02296b9ff20bc1bffcca4ed7ccf210a4fb (patch)
treeed59cf7e1fa4e7874072c2da12dc2e46fba30641
parentcf32b9e462c23937ec31c322ac6cd90d6c0e4ad7 (diff)
downloadgdm-2a3e3e02296b9ff20bc1bffcca4ed7ccf210a4fb.tar.gz
session: set session type to "x11" or "wayland" as appropriate
logind has a "session type" property which is useful for determining what kind of session the user is using. This commit makes sure that property gets set appropriately. https://bugzilla.gnome.org/show_bug.cgi?id=741658
-rw-r--r--daemon/gdm-session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 319b3633..fceac246 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -162,6 +162,7 @@ enum {
LAST_SIGNAL
};
+static gboolean gdm_session_is_wayland_session (GdmSession *self);
static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (GdmSession,
@@ -2395,6 +2396,7 @@ static void
set_up_session_environment (GdmSession *self)
{
GdmSessionDisplayMode display_mode;
+ const char *session_type = "x11";
gchar *desktop_names;
const char *locale;
@@ -2439,6 +2441,16 @@ set_up_session_environment (GdmSession *self)
}
}
+#ifdef ENABLE_WAYLAND_SUPPORT
+ if (gdm_session_is_wayland_session (self)) {
+ session_type = "wayland";
+ }
+#endif
+
+ gdm_session_set_environment_variable (self,
+ "XDG_SESSION_TYPE",
+ session_type);
+
if (g_getenv ("WINDOWPATH") != NULL) {
gdm_session_set_environment_variable (self,
"WINDOWPATH",