summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac23
-rw-r--r--daemon/gdm-session-worker.c10
-rw-r--r--daemon/gdm-session.c8
-rw-r--r--libgdm/gdm-sessions.c2
4 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3fac145d..82fbc901 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,12 @@ AC_ARG_ENABLE(systemd-journal,
AS_HELP_STRING([--enable-systemd-journal],
[Add journald support @<:@default=auto@:>@]),
[enable_systemd_journal=$enableval], [enable_systemd_journal=auto])
+AC_ARG_ENABLE(wayland-support,
+ AS_HELP_STRING([--enable-wayland-support],
+ [Enable support for wayland sessions @<:@default=auto@:>@]),
+ [enable_wayland_support=$enableval],
+ [enable_wayland_support=auto])
+
AC_ARG_WITH(plymouth,
AS_HELP_STRING([--with-plymouth],
[Add plymouth support @<:@default=auto@:>@]),
@@ -323,6 +329,8 @@ dnl checks needed for Darwin compatibility to linux **environ.
AC_CHECK_HEADERS(crt_externs.h)
AC_CHECK_FUNCS(_NSGetEnviron)
+AC_CHECK_HEADERS(sys/vt.h)
+
EXTRA_DAEMON_LIBS=""
EXTRA_SLAVE_LIBS=""
EXTRA_CHOOSER_LIBS=""
@@ -932,6 +940,20 @@ fi
AC_SUBST(JOURNALD_CFLAGS)
AC_SUBST(JOURNALD_LIBS)
+if test "x$enable_wayland_support" = "xauto" ; then
+ use_wayland="$use_systemd";
+else
+ use_wayland="$enable_wayland_support"
+fi
+
+if test "x$use_wayland" != "xno" ; then
+ if test "x$have_systemd" = "xno"; then
+ AC_MSG_ERROR([wayland support explicitly required, but logind not found])
+ fi
+
+ AC_DEFINE(ENABLE_WAYLAND_SUPPORT, 1, [Define to enable wayland support])
+fi
+
AC_PATH_PROG(SYSTEMD_X_SERVER, systemd-multi-seat-x, [/lib/systemd/systemd-multi-seat-x], [/lib/systemd:/usr/lib/systemd:$PATH])
AC_SUBST(SYSTEMD_X_SERVER)
AC_DEFINE_UNQUOTED(SYSTEMD_X_SERVER,"$SYSTEMD_X_SERVER",[Path to systemd X server wrapper])
@@ -1631,6 +1653,7 @@ echo \
systemd support: ${use_systemd}
systemd unit dir: ${with_systemdsystemunitdir}
plymouth support: ${use_plymouth}
+ wayland support: ${use_wayland}
Build with RBAC: ${msg_rbac_shutdown}
Initial VT: ${GDM_INITIAL_VT}
Enable documentation: ${enable_documentation}
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index b792c58d..942fedce 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -28,8 +28,10 @@
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
+#ifdef ENABLE_WAYLAND_SUPPORT
#include <sys/ioctl.h>
#include <sys/vt.h>
+#endif
#include <errno.h>
#include <grp.h>
#include <pwd.h>
@@ -954,6 +956,7 @@ gdm_session_worker_stop_auditor (GdmSessionWorker *worker)
worker->priv->auditor = NULL;
}
+#ifdef ENABLE_WAYLAND_SUPPORT
static void
jump_to_vt (GdmSessionWorker *worker,
int vt_number)
@@ -970,6 +973,7 @@ jump_to_vt (GdmSessionWorker *worker,
}
close(fd);
}
+#endif
static void
gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
@@ -1000,9 +1004,11 @@ gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
gdm_session_worker_stop_auditor (worker);
+#ifdef ENABLE_WAYLAND_SUPPORT
if (worker->priv->login_vt != worker->priv->session_vt) {
jump_to_vt (worker, worker->priv->login_vt);
}
+#endif
worker->priv->login_vt = 0;
worker->priv->session_vt = 0;
@@ -1976,6 +1982,7 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
return TRUE;
}
+#ifdef ENABLE_WAYLAND_SUPPORT
static gboolean
set_up_for_new_vt (GdmSessionWorker *worker)
{
@@ -2029,6 +2036,7 @@ fail:
close (fd);
return FALSE;
}
+#endif
static gboolean
set_up_for_current_vt (GdmSessionWorker *worker,
@@ -2117,6 +2125,7 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
return FALSE;
}
break;
+#ifdef ENABLE_WAYLAND_SUPPORT
case GDM_SESSION_DISPLAY_MODE_NEW_VT:
case GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED:
if (!set_up_for_new_vt (worker)) {
@@ -2127,6 +2136,7 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
return FALSE;
}
break;
+#endif
}
flags = 0;
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index d519b357..e2106788 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -363,7 +363,9 @@ get_system_session_dirs (void)
DMCONFDIR "/Sessions/",
DATADIR "/gdm/BuiltInSessions/",
DATADIR "/xsessions/",
+#ifdef ENABLE_WAYLAND_SUPPORT
DATADIR "/wayland-sessions/",
+#endif
NULL
};
@@ -2661,6 +2663,7 @@ get_session_filename (GdmSession *self)
return g_strdup_printf ("%s.desktop", get_session_name (self));
}
+#ifdef ENABLE_WAYLAND_SUPPORT
static gboolean
gdm_session_is_wayland_session (GdmSession *self)
{
@@ -2689,6 +2692,7 @@ out:
g_free (filename);
return is_wayland_session;
}
+#endif
gboolean
gdm_session_bypasses_xsession (GdmSession *self)
@@ -2702,9 +2706,11 @@ gdm_session_bypasses_xsession (GdmSession *self)
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
+#ifdef ENABLE_WAYLAND_SUPPORT
if (gdm_session_is_wayland_session (self)) {
return TRUE;
}
+#endif
filename = get_session_filename (self);
@@ -2734,12 +2740,14 @@ out:
GdmSessionDisplayMode
gdm_session_get_display_mode (GdmSession *self)
{
+#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 (gdm_session_is_wayland_session (self)) {
return GDM_SESSION_DISPLAY_MODE_NEW_VT;
}
+#endif
/* X sessions are for now ran in classic mode where
* we reuse the existing greeter. */
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
index 2971f17b..08220fe0 100644
--- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -193,7 +193,9 @@ collect_sessions (void)
DMCONFDIR "/Sessions/",
DATADIR "/gdm/BuiltInSessions/",
DATADIR "/xsessions/",
+#ifdef ENABLE_WAYLAND_SUPPORT
DATADIR "/wayland-sessions/",
+#endif
NULL
};