diff options
author | Richard Hansen <rhansen@rhansen.org> | 2023-04-16 23:19:27 -0400 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2023-04-28 13:34:51 +1200 |
commit | dcd37d9548049a9764a4286dd238f6731826e8ee (patch) | |
tree | 63fce3712cde93fdb4f6fc5472d04c045b7a47e3 | |
parent | 6a5bca08577e4bbba486f09df2cfbd8080643d39 (diff) | |
download | lightdm-git-dcd37d9548049a9764a4286dd238f6731826e8ee.tar.gz |
Initialize WaylandSessionPrivate.vt to -1
This matters when starting a Wayland session on a non-seat0 seat:
* It eliminates an erroneous attempt to switch to VT 0.
* The XDG_VTNR environment variable is no longer set.
Also add a multiseat test.
A similar change for XServerLocalPrivate is not needed because its vt field is
already initialized to -1.
-rw-r--r-- | src/wayland-session.c | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/scripts/multi-seat-wayland.conf | 64 | ||||
-rwxr-xr-x | tests/test-multi-seat-wayland | 2 |
4 files changed, 70 insertions, 0 deletions
diff --git a/src/wayland-session.c b/src/wayland-session.c index 187bf1f0..b2dc8201 100644 --- a/src/wayland-session.c +++ b/src/wayland-session.c @@ -78,6 +78,8 @@ wayland_session_disconnect_session (DisplayServer *display_server, Session *sess static void wayland_session_init (WaylandSession *session) { + WaylandSessionPrivate *priv = wayland_session_get_instance_private (session); + priv->vt = -1; } static void diff --git a/tests/Makefile.am b/tests/Makefile.am index 1002c834..734f6482 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -246,6 +246,7 @@ TESTS = \ test-multi-seat-change-graphical \ test-multi-seat-change-graphical-disabled \ test-multi-seat-globbing-config-sections \ + test-multi-seat-wayland \ test-mir-autologin \ test-mir-greeter \ test-mir-session \ @@ -480,6 +481,7 @@ EXTRA_DIST = \ scripts/multi-seat-seat0-non-graphical.conf \ scripts/multi-seat-seat0-non-graphical-disabled.conf \ scripts/multi-seat-globbing-config-sections.conf \ + scripts/multi-seat-wayland.conf \ scripts/no-accounts-service.conf \ scripts/no-config.conf \ scripts/no-console-kit.conf \ diff --git a/tests/scripts/multi-seat-wayland.conf b/tests/scripts/multi-seat-wayland.conf new file mode 100644 index 00000000..a9b6871c --- /dev/null +++ b/tests/scripts/multi-seat-wayland.conf @@ -0,0 +1,64 @@ +# +# Check that non-seat0 Wayland sessions are started properly. +# + +[Seat:*] +user-session=wayland + +#?*START-DAEMON +#?RUNNER DAEMON-START + +# seat0 starts. +#?XSERVER-0 START VT=7 SEAT=seat0 +#?*XSERVER-0 INDICATE-READY +#?XSERVER-0 INDICATE-READY +#?XSERVER-0 ACCEPT-CONNECT +#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_SESSION_CLASS=greeter +#?LOGIN1 ACTIVATE-SESSION SESSION=c0 +#?XSERVER-0 ACCEPT-CONNECT +#?GREETER-X-0 CONNECT-XSERVER +#?GREETER-X-0 CONNECT-TO-DAEMON +#?GREETER-X-0 CONNECTED-TO-DAEMON + +# Add seat1. +#?*ADD-SEAT ID=seat1 +#?XSERVER-1 START SEAT=seat1 +#?*XSERVER-1 INDICATE-READY +#?XSERVER-1 INDICATE-READY +#?XSERVER-1 ACCEPT-CONNECT +#?GREETER-X-1 START XDG_SEAT=seat1 XDG_SESSION_CLASS=greeter +#?LOGIN1 ACTIVATE-SESSION SESSION=c1 +#?XSERVER-1 ACCEPT-CONNECT +#?GREETER-X-1 CONNECT-XSERVER +#?GREETER-X-1 CONNECT-TO-DAEMON +#?GREETER-X-1 CONNECTED-TO-DAEMON + +# Log in to seat1. +#?*GREETER-X-1 AUTHENTICATE USERNAME=no-password2 +#?GREETER-X-1 AUTHENTICATION-COMPLETE USERNAME=no-password2 AUTHENTICATED=TRUE +#?*GREETER-X-1 START-SESSION +#?GREETER-X-1 TERMINATE SIGNAL=15 +#?XSERVER-1 TERMINATE SIGNAL=15 +#?SESSION-WAYLAND START XDG_SEAT=seat1 XDG_GREETER_DATA_DIR=.*/no-password2 XDG_SESSION_TYPE=wayland XDG_SESSION_DESKTOP=wayland USER=no-password2 +#?LOGIN1 ACTIVATE-SESSION SESSION=c2 + +# Log out. The X server and greeter for seat1 should start again. +#?*SESSION-WAYLAND LOGOUT +#?XSERVER-1 START SEAT=seat1 +#?*XSERVER-1 INDICATE-READY +#?XSERVER-1 INDICATE-READY +#?XSERVER-1 ACCEPT-CONNECT +#?GREETER-X-1 START XDG_SEAT=seat1 XDG_SESSION_CLASS=greeter +#?LOGIN1 ACTIVATE-SESSION SESSION=c3 +#?XSERVER-1 ACCEPT-CONNECT +#?GREETER-X-1 CONNECT-XSERVER +#?GREETER-X-1 CONNECT-TO-DAEMON +#?GREETER-X-1 CONNECTED-TO-DAEMON + +# Clean up. +#?*STOP-DAEMON +#?GREETER-X-0 TERMINATE SIGNAL=15 +#?XSERVER-0 TERMINATE SIGNAL=15 +#?GREETER-X-1 TERMINATE SIGNAL=15 +#?XSERVER-1 TERMINATE SIGNAL=15 +#?RUNNER DAEMON-EXIT STATUS=0 diff --git a/tests/test-multi-seat-wayland b/tests/test-multi-seat-wayland new file mode 100755 index 00000000..819d6f3e --- /dev/null +++ b/tests/test-multi-seat-wayland @@ -0,0 +1,2 @@ +#!/bin/sh +./src/dbus-env ./src/test-runner multi-seat-wayland test-gobject-greeter |