mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-22 15:12:26 +00:00
Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not all
seat0s have TTYs
This commit is contained in:
parent
fa05d3cde6
commit
e44bed0c2b
@ -130,8 +130,8 @@ static void logind_release_device(struct wlr_session *base, int fd) {
|
|||||||
static bool logind_change_vt(struct wlr_session *base, unsigned vt) {
|
static bool logind_change_vt(struct wlr_session *base, unsigned vt) {
|
||||||
struct logind_session *session = logind_session_from_session(base);
|
struct logind_session *session = logind_session_from_session(base);
|
||||||
|
|
||||||
// Only seat0 has VTs associated with it
|
// Only if seat has VTs associated with it
|
||||||
if (strcmp(session->base.seat, "seat0") != 0) {
|
if (!sd_seat_can_tty(session->base.seat)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
|
|||||||
}
|
}
|
||||||
snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat);
|
snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat);
|
||||||
|
|
||||||
if (strcmp(seat, "seat0") == 0) {
|
if (sd_seat_can_tty(seat)) {
|
||||||
ret = sd_session_get_vt(session->id, &session->base.vtnr);
|
ret = sd_session_get_vt(session->id, &session->base.vtnr);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
wlr_log(WLR_ERROR, "Session not running in virtual terminal");
|
wlr_log(WLR_ERROR, "Session not running in virtual terminal");
|
||||||
|
Loading…
Reference in New Issue
Block a user