From 51c7467516d6213d1ff614e4db1e216de6367cc8 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 18 Sep 2020 15:38:53 +0200 Subject: 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. --- include/client.h | 3 +-- include/seat.h | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/client.h b/include/client.h index 75e4f46..3b1f105 100644 --- a/include/client.h +++ b/include/client.h @@ -21,7 +21,7 @@ struct client { gid_t gid; struct seat *seat; - int seat_vt; + int session; bool pending_disable; struct linked_list devices; @@ -31,7 +31,6 @@ struct client *client_create(struct server *server, int client_fd); void client_destroy(struct client *client); int client_handle_connection(int fd, uint32_t mask, void *data); -int client_get_session(const struct client *client); int client_send_enable_seat(struct client *client); int client_send_disable_seat(struct client *client); diff --git a/include/seat.h b/include/seat.h index 30f7cc4..2d269cc 100644 --- a/include/seat.h +++ b/include/seat.h @@ -33,9 +33,9 @@ struct seat { struct client *next_client; bool vt_bound; - bool vt_pending_ack; - int next_vt; - int curttyfd; + int cur_ttyfd; + int cur_vt; + int session_cnt; }; struct seat *seat_create(const char *name, bool vt_bound); @@ -52,7 +52,7 @@ int seat_close_device(struct client *client, struct seat_device *seat_device); struct seat_device *seat_find_device(struct client *client, int device_id); int seat_set_next_session(struct client *client, int session); -int seat_activate(struct seat *seat); +int seat_vt_activate(struct seat *seat); int seat_prepare_vt_switch(struct seat *seat); #endif -- cgit v1.2.3