mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-10 11:30:15 +01:00
eis: only allow the available caps to bind to a seat
A client binding with caps >= the seat's current version will get disconnected now.
This commit is contained in:
parent
ea8df6402a
commit
b481eff34c
1 changed files with 14 additions and 0 deletions
|
|
@ -90,6 +90,20 @@ client_msg_release(struct eis_seat *seat)
|
|||
static int
|
||||
client_msg_bind(struct eis_seat *seat, uint32_t caps)
|
||||
{
|
||||
uint32_t allowed_caps = 0;
|
||||
|
||||
if (seat->proto_object.version >= EIS_SEAT_CAPABILITIES_POINTER_SINCE_VERSION)
|
||||
allowed_caps |= EIS_SEAT_CAPABILITIES_POINTER;
|
||||
if (seat->proto_object.version >= EIS_SEAT_CAPABILITIES_POINTER_ABSOLUTE_SINCE_VERSION)
|
||||
allowed_caps |= EIS_SEAT_CAPABILITIES_POINTER_ABSOLUTE;
|
||||
if (seat->proto_object.version >= EIS_SEAT_CAPABILITIES_KEYBOARD_SINCE_VERSION)
|
||||
allowed_caps |= EIS_SEAT_CAPABILITIES_KEYBOARD;
|
||||
if (seat->proto_object.version >= EIS_SEAT_CAPABILITIES_TOUCHSCREEN_SINCE_VERSION)
|
||||
allowed_caps |= EIS_SEAT_CAPABILITIES_TOUCHSCREEN;
|
||||
|
||||
if (caps & ~allowed_caps)
|
||||
return -EINVAL;
|
||||
|
||||
eis_seat_bind(seat, caps);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue