[gdm/wip/wayland-rebase: 9/12] manager: Reset our own greeter when in a Wayland session



commit 4ed5d467ef25cecbaf3392d6d8009bca69799762
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 11 12:45:13 2014 -0500

    manager: Reset our own greeter when in a Wayland session
    
    Rather than morphing our own X server into the user's session, reset
    the login screen on the same VT, and start the user session. GNOME will
    activate its session when ready.
    
    XXX: we shouldn't restart the greeter, we should show a spinner and then
    restart the greeter when GNOME takes control

 daemon/gdm-manager.c |   16 ++++++++++++++++
 daemon/gdm-session.c |    6 ++++++
 daemon/gdm-session.h |    1 +
 3 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 3f8f228..899ef13 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -870,6 +870,22 @@ on_start_user_session (StartUserSessionOperation *operation)
                    user switching. */
                 gdm_session_reset (operation->session);
                 destroy_start_user_session_operation (operation);
+        } else if (gdm_session_has_own_display_server (operation->session)) {
+                GdmDisplay *display;
+                uid_t allowed_uid;
+
+                g_debug ("GdmManager: session has its display server, reusing our server for another login 
screen");
+
+                allowed_uid = gdm_session_get_allowed_user (operation->session);
+
+                display = get_display_for_session (operation->manager, operation->session);
+                g_object_set_data (G_OBJECT (display), "gdm-session", NULL);
+                g_object_set_data (G_OBJECT (operation->session), "gdm-display", NULL);
+
+                gdm_display_reset_initial_session (display);
+                create_session_for_display (operation->manager, display, allowed_uid);
+
+                start_user_session (operation->manager, NULL, operation);
         } else {
                 GdmDisplay *display;
                 const char *username;
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 7b6b5e2..45b8acc 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -2691,6 +2691,12 @@ out:
         return bypasses_xsession;
 }
 
+gboolean
+gdm_session_has_own_display_server (GdmSession *self)
+{
+        return FALSE;
+}
+
 void
 gdm_session_select_program (GdmSession *self,
                             const char *text)
diff --git a/daemon/gdm-session.h b/daemon/gdm-session.h
index fb190bf..87e27b4 100644
--- a/daemon/gdm-session.h
+++ b/daemon/gdm-session.h
@@ -111,6 +111,7 @@ const char       *gdm_session_get_display_device          (GdmSession     *sessi
 const char       *gdm_session_get_display_seat_id         (GdmSession     *session);
 const char       *gdm_session_get_session_id              (GdmSession     *session);
 gboolean          gdm_session_bypasses_xsession           (GdmSession     *session);
+gboolean          gdm_session_has_own_display_server      (GdmSession     *session);
 
 void              gdm_session_start_conversation          (GdmSession *session,
                                                            const char *service_name);


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