summaryrefslogtreecommitdiff
path: root/daemon/gdm-session.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2017-02-23 13:46:57 -0500
committerRay Strode <rstrode@redhat.com>2017-02-27 17:04:22 -0500
commit22de251816f7c9399f5cddc54ac350e0f445c0dc (patch)
treee328579bf8521f8f9e7bf2bf1be7f75f9533513f /daemon/gdm-session.c
parent5b1e625417c274823c66a552f37d912986fc34d8 (diff)
downloadgdm-22de251816f7c9399f5cddc54ac350e0f445c0dc.tar.gz
daemon: add knob to disable starting X server as user
Some deployments need to be able to turn off running X servers as a user for backward compatibility. This commit adds some #ifdef goop to that end. Note wayland requires running as the user, so this option, merely deprioritizes wayland sessions under X sessions. https://bugzilla.gnome.org/show_bug.cgi?id=779338
Diffstat (limited to 'daemon/gdm-session.c')
-rw-r--r--daemon/gdm-session.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 492ce32d..70130ac2 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -358,7 +358,11 @@ get_system_session_dirs (GdmSession *self)
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
#ifdef ENABLE_WAYLAND_SUPPORT
+#ifdef ENABLE_USER_DISPLAY_SERVER
g_array_prepend_val (search_array, wayland_search_dir);
+#else
+ g_array_append_val (search_array, wayland_search_dir);
+#endif
#endif
}
@@ -3107,6 +3111,7 @@ gdm_session_get_display_mode (GdmSession *self)
return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
}
+#ifdef ENABLE_USER_DISPLAY_SERVER
/* 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
@@ -3129,6 +3134,18 @@ gdm_session_get_display_mode (GdmSession *self)
* are paused when handed out.
*/
return GDM_SESSION_DISPLAY_MODE_NEW_VT;
+#else
+
+#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
+ return GDM_SESSION_DISPLAY_MODE_REUSE_VT;
+#endif
}
void