eis: fix the seat assignment

We're using the upper bits for seats, just adding 1 clashes with the
device ids.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2021-08-17 16:08:04 +10:00
parent 1134630655
commit eaefaecdd0
2 changed files with 4 additions and 3 deletions

View file

@ -391,7 +391,7 @@ handle_msg_device_added(struct ei *ei, uint32_t deviceid, uint32_t seatid,
* won't know which unless we keep some device ID table. Not worth
* it, so just silently ignore */
if (ei_seat_find_device(seat, deviceid)) {
log_error(ei, "Server sent duplicate device id %d\n", deviceid);
log_error(ei, "Server sent duplicate device id %#x\n", deviceid);
return -EINVAL;
}

View file

@ -64,10 +64,11 @@ eis_seat_get_client(struct eis_seat *seat)
_public_ struct eis_seat *
eis_client_new_seat(struct eis_client *client, const char *name)
{
static uint32_t seatid = 0x10000; /* we leave the lower bits to the deviceids */
static uint32_t seatid;
struct eis_seat *seat = eis_seat_create(&client->object);
seat->id = seatid++;
/* we leave the lower bits to the deviceids */
seat->id = ++seatid << 16;
seat->state = EIS_SEAT_STATE_PENDING;
seat->name = xstrdup(name);
list_init(&seat->devices);