]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blobdiff - src/seat-unity.c
Merge from trunk
[sojka/lightdm.git] / src / seat-unity.c
index b6db8aa9214e404c9ec015cc7e9a74d9dd46e30c..ce6bc5a6148c86a56e634e2c5d0116f3f9fe2019 100644 (file)
@@ -520,23 +520,6 @@ seat_unity_create_greeter_session (Seat *seat)
     return greeter_session;
 }
 
-static Session *
-seat_unity_create_session (Seat *seat)
-{
-    Session *session;
-
-    session = session_new ();
-    session_set_env (session, "XDG_SEAT", "seat0");
-    if (!SEAT_UNITY (seat)->priv->use_vt_switching)
-    {
-        gchar *value = g_strdup_printf ("%d", SEAT_UNITY (seat)->priv->vt);
-        session_set_env (SESSION (session), "XDG_VTNR", value);
-        g_free (value);
-    }
-
-    return session;
-}
-
 static void
 seat_unity_set_active_session (Seat *seat, Session *session)
 {
@@ -605,6 +588,31 @@ seat_unity_get_active_session (Seat *seat)
     return SEAT_UNITY (seat)->priv->active_session;
 }
 
+static Session *
+seat_unity_create_session (Seat *seat, Session *user_session)
+{
+    Session *session;
+
+    session = session_new ();
+    session_set_env (session, "XDG_SEAT", "seat0");
+    if (!SEAT_UNITY (seat)->priv->use_vt_switching)
+    {
+        gchar *value = g_strdup_printf ("%d", SEAT_UNITY (seat)->priv->vt);
+        session_set_env (SESSION (session), "XDG_VTNR", value);
+        g_free (value);
+
+        /* Notify compositor that user's session should be displayed under
+           greeter.  Note that we actually just set the active session, because
+           the compositor should know to always keep the greeter above any
+           sessions.  So we are only adjusting the session relative to other
+           user sessions. */
+        if (user_session != NULL)
+            seat_unity_set_active_session (seat, user_session);
+    }
+
+    return session;
+}
+
 static void
 seat_unity_run_script (Seat *seat, DisplayServer *display_server, Process *script)
 {