summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>2020-06-03 10:01:06 -0300
committerPekka Paalanen <pq@iki.fi>2020-06-25 10:17:31 +0000
commit887a7e5717275c0dec007e6128298d5956c70891 (patch)
tree0c40a11ae80d197e5d572e433635e583753cffcc
parent77d06f7b8bc40f402468d4a5ab5ac8f935b0b971 (diff)
downloadweston-887a7e5717275c0dec007e6128298d5956c70891.tar.gz
launcher: do not touch VT/tty while using non-default seat
Launcher-direct does not allow us to run using a different seat from the default seat0. This happens because VTs are only exposed to the default seat, and users that are on non-default seat should not touch VTs. Add check in launcher-direct to skip VT/tty management if user is running on a non-default seat. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
-rw-r--r--libweston/launcher-direct.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
index 9fa329b6..382ca49f 100644
--- a/libweston/launcher-direct.c
+++ b/libweston/launcher-direct.c
@@ -301,9 +301,13 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
launcher->base.iface = &launcher_direct_iface;
launcher->compositor = compositor;
- if (setup_tty(launcher, tty) == -1) {
- free(launcher);
- return -1;
+ if (strcmp("seat0", seat_id) == 0) {
+ if (setup_tty(launcher, tty) == -1) {
+ free(launcher);
+ return -1;
+ }
+ } else {
+ launcher->tty = -1;
}
* (struct launcher_direct **) out = launcher;
@@ -315,11 +319,11 @@ launcher_direct_destroy(struct weston_launcher *launcher_base)
{
struct launcher_direct *launcher = wl_container_of(launcher_base, launcher, base);
- launcher_direct_restore(&launcher->base);
- wl_event_source_remove(launcher->vt_source);
-
- if (launcher->tty >= 0)
+ if (launcher->tty >= 0) {
+ launcher_direct_restore(&launcher->base);
+ wl_event_source_remove(launcher->vt_source);
close(launcher->tty);
+ }
free(launcher);
}