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>
This commit is contained in:
parent
77d06f7b8b
commit
887a7e5717
@ -301,9 +301,13 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
|
|||||||
launcher->base.iface = &launcher_direct_iface;
|
launcher->base.iface = &launcher_direct_iface;
|
||||||
launcher->compositor = compositor;
|
launcher->compositor = compositor;
|
||||||
|
|
||||||
if (setup_tty(launcher, tty) == -1) {
|
if (strcmp("seat0", seat_id) == 0) {
|
||||||
free(launcher);
|
if (setup_tty(launcher, tty) == -1) {
|
||||||
return -1;
|
free(launcher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
launcher->tty = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
* (struct launcher_direct **) out = launcher;
|
* (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);
|
struct launcher_direct *launcher = wl_container_of(launcher_base, launcher, base);
|
||||||
|
|
||||||
launcher_direct_restore(&launcher->base);
|
if (launcher->tty >= 0) {
|
||||||
wl_event_source_remove(launcher->vt_source);
|
launcher_direct_restore(&launcher->base);
|
||||||
|
wl_event_source_remove(launcher->vt_source);
|
||||||
if (launcher->tty >= 0)
|
|
||||||
close(launcher->tty);
|
close(launcher->tty);
|
||||||
|
}
|
||||||
|
|
||||||
free(launcher);
|
free(launcher);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user