eis: require ei_seat and ei_devices

A client that skips on announcing those will get connected and
immediately disconnected again. There's no point to libei if you support
neither of those (at least for now).
This commit is contained in:
Peter Hutterer 2023-02-14 13:13:50 +10:00
parent df99fc923b
commit e0d0c1af61

View file

@ -99,11 +99,18 @@ client_msg_done(struct eis_connection_setup *setup)
eis_connection_setup_event_connection(setup, eis_connection_get_id(client->connection),
eis_connection_get_version(client->connection));
client->setup = eis_connection_setup_unref(setup);
/* These aren't required but libei is pointless without them, so let's enforce them
* by establishing the connection and immediately sending the disconnect */
if (setup->client_versions.ei_seat == 0 ||
setup->client_versions.ei_device == 0) {
eis_client_disconnect(client);
} else {
/* Force a ping/pong. This isn't necessary but it doesn't hurt much here
* and it ensures that any client implementation doesn't have that part missing */
eis_connection_ping(client->connection, pong, NULL);
}
/* Force a ping/pong. This isn't necessary but it doesn't hurt much here
* and it ensures that any client implementation doesn't have that part missing */
eis_connection_ping(client->connection, pong, NULL);
client->setup = eis_connection_setup_unref(setup);
return 0;
}