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-18 13:50:17 -0500
commit806f2de647803a4f5890dc56d5ffe93ac489946b (patch)
tree144f6c72d19772d28a97ee214bc4a5e1131b6a89
parentb58b60affe05334df19c5d6bb0a4e9b3706b6a7b (diff)
downloadgdm-806f2de647803a4f5890dc56d5ffe93ac489946b.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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index d0f64923..ab8b2fbe 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,
@@ -2454,6 +2455,24 @@ send_display_mode (GdmSession *self,
NULL, NULL, NULL);
}
+static void
+send_session_type (GdmSession *self,
+ GdmSessionConversation *conversation)
+{
+ const char *session_type = "x11";
+
+#ifdef ENABLE_WAYLAND_SUPPORT
+ if (gdm_session_is_wayland_session (self)) {
+ session_type = "wayland";
+ }
+#endif
+
+ gdm_dbus_worker_call_set_environment_variable (conversation->worker_proxy,
+ "XDG_SESSION_TYPE",
+ session_type,
+ NULL, NULL, NULL);
+}
+
void
gdm_session_open_session (GdmSession *self,
const char *service_name)
@@ -2466,6 +2485,7 @@ gdm_session_open_session (GdmSession *self,
if (conversation != NULL) {
send_display_mode (self, conversation);
+ send_session_type (self, conversation);
gdm_dbus_worker_call_open (conversation->worker_proxy,
NULL,