client: Replace pending_disable with state enum

This simplifies logic in seat handling.
This commit is contained in:
Kenny Levinsen 2021-02-27 15:13:18 +01:00
parent b1f7ec1c4d
commit 45bab8b258
3 changed files with 30 additions and 22 deletions

View file

@ -10,6 +10,14 @@
struct server;
enum client_state {
CLIENT_NEW,
CLIENT_ACTIVE,
CLIENT_PENDING_DISABLE,
CLIENT_DISABLED,
CLIENT_CLOSED
};
struct client {
struct linked_list link; // seat::clients
struct server *server;
@ -22,7 +30,7 @@ struct client {
struct seat *seat;
int session;
bool pending_disable;
enum client_state state;
struct linked_list devices;
};