mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-20 04:30:07 +01:00
eis: only send scroll/button capabilities if the client supports them
Commita902d5dbd8("protocol: replace the capabilities enum with an interface list") added automatic handling for button/scroll interfaces on the protocol because the libeis C API didn't have those as separate interfaces yet. Any EIS implementation with POINTER/POINTER_ABSOLUTE would always announce BUTTON/SCROLL capabilities. Later in commite6954b76d3("eis: change the API to match the protocol interfaces closer") the required C APIs were added but this handling was never removed so an EIS implementation always replied with button/scroll capabilities even where not set. Fix this by removing this automatic announcement. Fixes:e6954b76d3("eis: change the API to match the protocol interfaces closer") Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/353>
This commit is contained in:
parent
7347aeacd2
commit
3b98946b9a
1 changed files with 6 additions and 4 deletions
|
|
@ -190,14 +190,16 @@ eis_seat_add(struct eis_seat *seat)
|
|||
mask_add(seat->capabilities.proto_mask, mask);
|
||||
}
|
||||
|
||||
if (seat->capabilities.c_mask & (EIS_DEVICE_CAP_POINTER|EIS_DEVICE_CAP_POINTER_ABSOLUTE) &&
|
||||
(client->interface_versions.ei_pointer > 0 || client->interface_versions.ei_pointer_absolute > 0)) {
|
||||
if (seat->capabilities.c_mask & EIS_DEVICE_CAP_SCROLL &&
|
||||
client->interface_versions.ei_scroll > 0) {
|
||||
uint64_t mask = bit(EIS_SCROLL_INTERFACE_INDEX);
|
||||
eis_seat_event_capability(seat, mask,
|
||||
EIS_SCROLL_INTERFACE_NAME);
|
||||
mask_add(seat->capabilities.proto_mask, mask);
|
||||
|
||||
mask = bit(EIS_BUTTON_INTERFACE_INDEX);
|
||||
}
|
||||
if (seat->capabilities.c_mask & EIS_DEVICE_CAP_BUTTON &&
|
||||
client->interface_versions.ei_button > 0) {
|
||||
uint64_t mask = bit(EIS_BUTTON_INTERFACE_INDEX);
|
||||
eis_seat_event_capability(seat, mask,
|
||||
EIS_BUTTON_INTERFACE_NAME);
|
||||
mask_add(seat->capabilities.proto_mask, mask);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue