[gdm] session: set session type to "x11" or "wayland" as appropriate



commit 806f2de647803a4f5890dc56d5ffe93ac489946b
Author: Ray Strode <rstrode redhat com>
Date:   Wed Dec 17 11:30:07 2014 -0500

    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

 daemon/gdm-session.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index d0f6492..ab8b2fb 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]