Log a bug if a client tries to send a discrete value 1

Discrete values are multiples of 120 and it's unlikely the device to be
emulated is *that* precise, so let's assume it's a bug and the client
wasn't aware of the 120-multiple requirement.
This commit is contained in:
Peter Hutterer 2023-05-29 18:08:01 +10:00
parent 3e908c03f4
commit 3ef22c8ed0
2 changed files with 10 additions and 0 deletions

View file

@ -1482,6 +1482,11 @@ ei_device_scroll_discrete(struct ei_device *device, int32_t x, int32_t y)
return;
}
if (abs(x) == 1 || abs(y) == 1) {
log_bug_client(ei_device_get_context(device),
"%s: suspicious discrete event value 1, did you mean 120?", __func__);
}
ei_device_resume_scrolling(device, x, y);
ei_send_pointer_scroll_discrete(device, x, y);

View file

@ -1158,6 +1158,11 @@ eis_device_scroll_discrete(struct eis_device *device, int32_t x, int32_t y)
if (device->state != EIS_DEVICE_STATE_EMULATING)
return;
if (abs(x) == 1 || abs(y) == 1) {
log_bug_client(eis_device_get_context(device),
"%s: suspicious discrete event value 1, did you mean 120?", __func__);
}
eis_device_resume_scrolling(device, x, y);
device->send_frame_event = true;