diff --git a/src/lightdm.c b/src/lightdm.c index 0ccfcd78..7fd77ed9 100644 --- a/src/lightdm.c +++ b/src/lightdm.c @@ -423,12 +423,10 @@ add_login1_seat (Login1Seat *login1_seat) { set_seat_properties (seat, seat_name); - if (!login1_seat_get_can_multi_session (login1_seat)) - { + gboolean can_multi_session = login1_seat_get_can_multi_session (login1_seat); + if (!can_multi_session) g_debug ("Seat %s has property CanMultiSession=no", seat_name); - /* XXX: uncomment this line after bug #1371250 is closed. - seat_set_property (seat, "allow-user-switching", "false"); */ - } + seat_set_supports_multi_session (seat, can_multi_session); if (is_seat0) seat_set_property (seat, "exit-on-failure", "true"); diff --git a/tests/Makefile.am b/tests/Makefile.am index 734f6482..98a3acce 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -241,6 +241,7 @@ TESTS = \ test-multi-seat-autologin-seat1 \ test-multi-seat-seat0-non-graphical \ test-multi-seat-seat0-non-graphical-disabled \ + test-multi-seat-no-multi-session \ test-multi-seat-non-graphical \ test-multi-seat-non-graphical-disabled \ test-multi-seat-change-graphical \ @@ -476,6 +477,7 @@ EXTRA_DIST = \ scripts/multi-seat-change-graphical.conf \ scripts/multi-seat-change-graphical-disabled.conf \ scripts/multi-seat-login.conf \ + scripts/multi-seat-no-multi-session \ scripts/multi-seat-non-graphical.conf \ scripts/multi-seat-non-graphical-disabled.conf \ scripts/multi-seat-seat0-non-graphical.conf \ diff --git a/tests/scripts/multi-seat-no-multi-session.conf b/tests/scripts/multi-seat-no-multi-session.conf new file mode 100644 index 00000000..672b0e4a --- /dev/null +++ b/tests/scripts/multi-seat-no-multi-session.conf @@ -0,0 +1,86 @@ +# +# Check that logging out from a CanMultiSession=false seat activates greeter on +# that seat. +# + +[Seat:*] +user-session=default + +#?*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 CAN-MULTI-SESSION=FALSE +#?XSERVER-1 START SEAT=seat1 +#?*SEAT-CAN-SWITCH PATH=/org/freedesktop/DisplayManager/Seat1 +#?RUNNER SEAT-CAN-SWITCH PATH=/org/freedesktop/DisplayManager/Seat1 CAN-SWITCH=FALSE +#?*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 seat0 so that its active session is not a greeter (in case there is a +# cross-seat bug). +#?*GREETER-X-0 AUTHENTICATE USERNAME=no-password1 +#?GREETER-X-0 AUTHENTICATION-COMPLETE USERNAME=no-password1 AUTHENTICATED=TRUE +#?*GREETER-X-0 START-SESSION +#?GREETER-X-0 TERMINATE SIGNAL=15 +#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/no-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=no-password1 +#?LOGIN1 ACTIVATE-SESSION SESSION=c2 +#?XSERVER-0 ACCEPT-CONNECT +#?SESSION-X-0 CONNECT-XSERVER + +# Log in 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 +#?SESSION-X-1 START XDG_SEAT=seat1 XDG_GREETER_DATA_DIR=.*/no-password2 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=no-password2 +#?LOGIN1 ACTIVATE-SESSION SESSION=c3 +#?XSERVER-1 ACCEPT-CONNECT +#?SESSION-X-1 CONNECT-XSERVER + +# Logout seat1 +#?*SESSION-X-1 LOGOUT +#?XSERVER-1 TERMINATE SIGNAL=15 + +# Ensure that the X server and greeter for seat1 are not restarted until after +# the user logs out. WAIT is not needed here because XSERVER-1 cannot terminate +# and start concurrently. +#?*FENCE + +#?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=c4 +#?XSERVER-1 ACCEPT-CONNECT +#?GREETER-X-1 CONNECT-XSERVER +#?GREETER-X-1 CONNECT-TO-DAEMON +#?GREETER-X-1 CONNECTED-TO-DAEMON + +# Cleanup +#?*STOP-DAEMON +#?SESSION-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/src/test-runner.c b/tests/src/test-runner.c index 118c786f..7de9694c 100644 --- a/tests/src/test-runner.c +++ b/tests/src/test-runner.c @@ -697,10 +697,11 @@ handle_command (const gchar *command) } else if (strcmp (name, "SEAT-CAN-SWITCH") == 0) { + const gchar *path = g_hash_table_lookup (params, "PATH"); g_autoptr(GError) error = NULL; g_autoptr(GVariant) result = g_dbus_connection_call_sync (dbus_conn, "org.freedesktop.DisplayManager", - "/org/freedesktop/DisplayManager/Seat0", + path ? path : "/org/freedesktop/DisplayManager/Seat0", "org.freedesktop.DBus.Properties", "Get", g_variant_new ("(ss)", "org.freedesktop.DisplayManager.Seat", "CanSwitch"), @@ -711,6 +712,8 @@ handle_command (const gchar *command) &error); g_autoptr(GString) status = g_string_new ("RUNNER SEAT-CAN-SWITCH"); + if (path) + g_string_append_printf (status, " PATH=%s", path); if (result) { g_autoptr(GVariant) value = NULL; diff --git a/tests/test-multi-seat-no-multi-session b/tests/test-multi-seat-no-multi-session new file mode 100755 index 00000000..6ddd1034 --- /dev/null +++ b/tests/test-multi-seat-no-multi-session @@ -0,0 +1,2 @@ +#!/bin/sh +./src/dbus-env ./src/test-runner multi-seat-no-multi-session test-gobject-greeter