Merge pull request #455 from n3rdopolis/patch-1

Attempt to fix #454
This commit is contained in:
Drew DeVault 2017-12-02 13:53:13 -05:00 committed by GitHub
commit 8eceaa2291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -347,12 +347,6 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
goto error; goto error;
} }
ret = sd_session_get_vt(session->id, &session->base.vtnr);
if (ret < 0) {
wlr_log(L_ERROR, "Session not running in virtual terminal");
goto error;
}
char *seat; char *seat;
ret = sd_session_get_seat(session->id, &seat); ret = sd_session_get_seat(session->id, &seat);
if (ret < 0) { if (ret < 0) {
@ -360,6 +354,14 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
goto error; goto error;
} }
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) {
ret = sd_session_get_vt(session->id, &session->base.vtnr);
if (ret < 0) {
wlr_log(L_ERROR, "Session not running in virtual terminal");
goto error;
}
}
free(seat); free(seat);
ret = sd_bus_default_system(&session->bus); ret = sd_bus_default_system(&session->bus);