1 From d086d6e3bc75331048f9f235c03408c68df40457 Mon Sep 17 00:00:00 2001
2 From: Leandro Ribeiro <leandro.ribeiro@collabora.com>
3 Date: Wed, 3 Jun 2020 10:01:06 -0300
4 Subject: [PATCH 3/4] launcher: do not touch VT/tty while using non-default
7 Launcher-direct does not allow us to run using a different
8 seat from the default seat0. This happens because VTs are
9 only exposed to the default seat, and users that are on
10 non-default seat should not touch VTs.
12 Add check in launcher-direct to skip VT/tty management if user
13 is running on a non-default seat.
15 Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
16 (cherry picked from commit 887a7e5717275c0dec007e6128298d5956c70891)
17 Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
19 libweston/launcher-direct.c | 18 +++++++++++-------
20 1 file changed, 11 insertions(+), 7 deletions(-)
22 diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
23 index 8e21880..71c332a 100644
24 --- a/libweston/launcher-direct.c
25 +++ b/libweston/launcher-direct.c
26 @@ -303,9 +303,13 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
27 launcher->base.iface = &launcher_direct_iface;
28 launcher->compositor = compositor;
30 - if (setup_tty(launcher, tty) == -1) {
33 + if (strcmp("seat0", seat_id) == 0) {
34 + if (setup_tty(launcher, tty) == -1) {
42 * (struct launcher_direct **) out = launcher;
43 @@ -317,11 +321,11 @@ launcher_direct_destroy(struct weston_launcher *launcher_base)
45 struct launcher_direct *launcher = wl_container_of(launcher_base, launcher, base);
47 - launcher_direct_restore(&launcher->base);
48 - wl_event_source_remove(launcher->vt_source);
50 - if (launcher->tty >= 0)
51 + if (launcher->tty >= 0) {
52 + launcher_direct_restore(&launcher->base);
53 + wl_event_source_remove(launcher->vt_source);