From 9cb96f8353c05f52c08436a1357c1105efcc2459 Mon Sep 17 00:00:00 2001 From: nerdopolis Date: Wed, 20 Jan 2021 22:00:44 -0500 Subject: [PATCH] launcher-logind: handle any seat without VTs Instead of assuming that seat0 has TTYs, use logind to check if the seat has TTYs --- libweston/launcher-logind.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c index 55db326ab..580bb226d 100644 --- a/libweston/launcher-logind.c +++ b/libweston/launcher-logind.c @@ -779,9 +779,9 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor * goto err_session; } - r = strcmp(t, "seat0"); + r = sd_seat_can_tty(t); free(t); - if (r == 0) { + if (r > 0) { r = weston_sd_session_get_vt(wl->sid, &wl->vtnr); if (r < 0) { weston_log("logind: session not running on a VT\n"); @@ -792,6 +792,10 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor * r = -EINVAL; goto err_session; } + } else if (r < 0) { + weston_log("logind: could not determine if seat %s has ttys or not", t); + r = -EINVAL; + goto err_session; } loop = wl_display_get_event_loop(compositor->wl_display);