summaryrefslogtreecommitdiff
path: root/daemon/gdm-session.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-01-11 22:02:21 -0600
committerRay Strode <rstrode@redhat.com>2016-01-12 10:50:26 -0500
commitf69ac4039dd5b6025560ddca1bbb0b1c81acef8a (patch)
tree825bb3411468d623fb7160a168f1d19eab283d2e /daemon/gdm-session.c
parentbcec78755f8a1a611e7fce75b7498f9cfd1ffb57 (diff)
downloadgdm-f69ac4039dd5b6025560ddca1bbb0b1c81acef8a.tar.gz
session: explain rationale between display modes and simplify getter
gdm_session_get_display_mode is longer and more confusing than it needs to be. This commit, consolidates code paths together and adds a more descriptive comment explaining why NEW_VT display mode is used for everything but non-seat0 seats. Based on a patch and bug report by Michael Catanzaro <mcatanzaro@gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=760415
Diffstat (limited to 'daemon/gdm-session.c')
-rw-r--r--daemon/gdm-session.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 99f3a014..dc3b4973 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -3083,15 +3083,6 @@ gdm_session_get_display_mode (GdmSession *self)
self->priv->is_program_session? "yes" : "no",
self->priv->display_seat_id);
-#ifdef ENABLE_WAYLAND_SUPPORT
- /* Wayland sessions are for now assumed to run in a
- * mutter-launch-like environment, so we allocate
- * a new VT for them. */
- if (g_strcmp0 (self->priv->session_type, "wayland") == 0) {
- return GDM_SESSION_DISPLAY_MODE_NEW_VT;
- }
-#endif
-
/* Non-seat0 sessions share their X server with their login screen
* for now.
*/
@@ -3099,16 +3090,26 @@ gdm_session_get_display_mode (GdmSession *self)
return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
}
- /* The X session used for the login screen now is run
- * within the login session and managed by logind
- */
- if (self->priv->is_program_session) {
- return GDM_SESSION_DISPLAY_MODE_NEW_VT;
- }
-
- /* user based X sessions need us to allocate a VT for them
- * and jump to it up front, because the X servers logind support
- * currently relies on X running in the foreground VT.
+ /* All other cases (wayland login screen, X login screen,
+ * wayland user session, X user session) use the NEW_VT
+ * display mode. That display mode means that GDM allocates
+ * a new VT and jumps to it before starting the session. The
+ * session is expected to use logind to gain access to the
+ * display and input devices.
+ *
+ * GDM also has a LOGIND_MANAGED display mode which we can't
+ * use yet. The difference between it and NEW_VT, is with it,
+ * GDM doesn't do any VT handling at all, expecting the session
+ * and logind to do everything. The problem is, for wayland
+ * sessions it will cause flicker until * this bug is fixed:
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=745141
+ *
+ * Likewise, for X sessions it's problematic because
+ * 1) X doesn't call TakeControl before switching VTs
+ * 2) X doesn't support getting started "in the background"
+ * right now. It will die with an error if logind devices
+ * are paused when handed out.
*/
return GDM_SESSION_DISPLAY_MODE_NEW_VT;
}