seat: Rework seat activation/switch logic
The seat activation logic did not correctly handle VT switching and switching between multiple sessions. Session switching on VT-bound seats is now performed using a VT switch, taking advantage of VT signals to perform the actual switch. This simplifies switching logic and makes it more robust.
This commit is contained in:
parent
d16122e98a
commit
51c7467516
5 changed files with 186 additions and 190 deletions
|
@ -66,6 +66,7 @@ struct client *client_create(struct server *server, int client_fd) {
|
|||
client->uid = uid;
|
||||
client->gid = gid;
|
||||
client->pid = pid;
|
||||
client->session = -1;
|
||||
client->server = server;
|
||||
client->connection.fd = client_fd;
|
||||
linked_list_init(&client->devices);
|
||||
|
@ -453,15 +454,3 @@ fail:
|
|||
client_destroy(client);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int client_get_session(const struct client *client) {
|
||||
if (client->seat == NULL || client->seat->active_client != client) {
|
||||
return -1;
|
||||
}
|
||||
if (client->seat->vt_bound) {
|
||||
return client->seat_vt;
|
||||
}
|
||||
// TODO: Store some session sequence
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue