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



commit 2a3e3e02296b9ff20bc1bffcca4ed7ccf210a4fb
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 |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 319b363..fceac24 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",


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