common/configuration.c | 2 ++ data/lightdm.conf | 8 ++++++-- src/seat.c | 19 +++++++++++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/common/configuration.c b/common/configuration.c index 058e69e2..1500e46f 100644 --- a/common/configuration.c +++ b/common/configuration.c @@ -376,8 +376,10 @@ config_init (Configuration *config) g_hash_table_insert (config->priv->seat_keys, "allow-guest", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "guest-session", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "session-wrapper", GINT_TO_POINTER (KEY_SUPPORTED)); + g_hash_table_insert (config->priv->seat_keys, "wayland-session-wrapper", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "greeter-wrapper", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "guest-wrapper", GINT_TO_POINTER (KEY_SUPPORTED)); + g_hash_table_insert (config->priv->seat_keys, "wayland-guest-wrapper", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "display-setup-script", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "display-stopped-script", GINT_TO_POINTER (KEY_SUPPORTED)); g_hash_table_insert (config->priv->seat_keys, "greeter-setup-script", GINT_TO_POINTER (KEY_SUPPORTED)); diff --git a/data/lightdm.conf b/data/lightdm.conf index 9523576e..ecb2fb47 100644 --- a/data/lightdm.conf +++ b/data/lightdm.conf @@ -68,9 +68,11 @@ sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/w # allow-user-switching = True if allowed to switch users # allow-guest = True if guest login is allowed # guest-session = Session to load for guests (overrides user-session) -# session-wrapper = Wrapper script to run session with +# session-wrapper = Wrapper script to run X11 session with +# wayland-session-wrapper = Wrapper script to run wayland session with. This script runs before wayland session is started, thus no wayland/X11 session should be available. # greeter-wrapper = Wrapper script to run greeter with -# guest-wrapper = Wrapper script to run guest sessions with +# guest-wrapper = Wrapper script to run guest X11 sessions with +# wayland-guest-wrapper = Wrapper script to run guest wayland sessions with. This script runs before wayland session is started, thus no wayland/X11 session should be available. # display-setup-script = Script to run when starting a greeter session (runs as root) # display-stopped-script = Script to run after stopping the display server (runs as root) # greeter-setup-script = Script to run when starting a greeter (runs as root) @@ -109,8 +111,10 @@ xserver-command=/etc/X11/xinit/xserverrc #allow-guest=true #guest-session= session-wrapper=/etc/X11/Xsession +#wayland-session-wrapper= greeter-wrapper=/etc/X11/Xgreeter.lightdm #guest-wrapper= +#wayland-guest-wrapper= #display-setup-script= #display-stopped-script= #greeter-setup-script= diff --git a/src/seat.c b/src/seat.c index 85134180..679a285b 100644 --- a/src/seat.c +++ b/src/seat.c @@ -89,6 +89,17 @@ static DisplayServer *create_display_server (Seat *seat, Session *session); static gboolean start_display_server (Seat *seat, DisplayServer *display_server); static GreeterSession *create_greeter_session (Seat *seat); static void start_session (Seat *seat, Session *session); +static const gchar* get_session_wrapper(Seat *seat, Session *session, const char *x11_session_config, const char *wayland_session_config); + +static const gchar * +get_session_wrapper(Seat *seat, Session *session, const char *x11_session_config, const char *wayland_session_config) +{ + const gchar *session_type = session_get_session_type (session); + + g_return_val_if_fail (session_type != NULL, NULL); + + return seat_get_string_property (seat, (strcmp (session_type, "wayland") != 0) ? x11_session_config : wayland_session_config); +} static void free_seat_module (gpointer data) @@ -1029,7 +1040,7 @@ create_user_session (Seat *seat, const gchar *username, gboolean autostart) configure_session (session, session_config, session_name, language); session_set_username (session, username); session_set_do_authenticate (session, TRUE); - g_auto(GStrv) argv = get_session_argv (seat, session_config, seat_get_string_property (seat, "session-wrapper")); + g_auto(GStrv) argv = get_session_argv (seat, session_config, get_session_wrapper (seat, session, "session-wrapper", "wayland-session-wrapper")); session_set_argv (session, argv); return g_steal_pointer (&session); @@ -1069,8 +1080,8 @@ create_guest_session (Seat *seat, const gchar *session_name) configure_session (session, session_config, session_name, NULL); session_set_do_authenticate (session, TRUE); session_set_is_guest (session, TRUE); - g_auto(GStrv) argv = get_session_argv (seat, session_config, seat_get_string_property (seat, "session-wrapper")); - const gchar *guest_wrapper = seat_get_string_property (seat, "guest-wrapper"); + g_auto(GStrv) argv = get_session_argv (seat, session_config, get_session_wrapper (seat, session, "session-wrapper", "wayland-session-wrapper")); + const gchar *guest_wrapper = get_session_wrapper (seat, session, "guest-wrapper", "wayland-guest-wrapper"); if (guest_wrapper) { g_autofree gchar *path = g_find_program_in_path (guest_wrapper); @@ -1173,7 +1184,7 @@ greeter_start_session_cb (Greeter *greeter, SessionType type, const gchar *sessi } configure_session (session, session_config, session_name, language); - g_auto(GStrv) argv = get_session_argv (seat, session_config, seat_get_string_property (seat, "session-wrapper")); + g_auto(GStrv) argv = get_session_argv (seat, session_config, get_session_wrapper (seat, session, "session-wrapper", "wayland-session-wrapper")); session_set_argv (session, argv); }