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>
dev
Leandro Ribeiro 5 years ago committed by Pekka Paalanen
parent 77d06f7b8b
commit 887a7e5717
  1. 8
      libweston/launcher-direct.c

@ -301,10 +301,14 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
launcher->base.iface = &launcher_direct_iface;
launcher->compositor = compositor;
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;
return 0;
@ -315,11 +319,11 @@ launcher_direct_destroy(struct weston_launcher *launcher_base)
{
struct launcher_direct *launcher = wl_container_of(launcher_base, launcher, base);
if (launcher->tty >= 0) {
launcher_direct_restore(&launcher->base);
wl_event_source_remove(launcher->vt_source);
if (launcher->tty >= 0)
close(launcher->tty);
}
free(launcher);
}

Loading…
Cancel
Save