seat: support lo-res clients using hi-res backends

When the selected backend supports high-resolution scroll but the client
doesn't, we need to accumulate value120 deltas until we can notify a
discrete event.

In addition, add a expire time so accumulated deltas are reset after a
period of inactivity.
This commit is contained in:
José Expósito 2021-09-20 19:47:49 +02:00
parent 47e79a78ad
commit d1e70dc133
3 changed files with 44 additions and 2 deletions

View file

@ -53,6 +53,13 @@ struct wlr_seat_client {
// for use by wlr_seat_client_{next_serial,validate_event_serial}
struct wlr_serial_ringset serials;
bool needs_touch_frame;
// when the backend supports high-resolution scroll but the client doesn't,
// accumulate deltas until we can notify a discrete event.
int32_t acc_vertical_value120;
int32_t acc_horizontal_value120;
double acc_axis;
uint32_t last_value120_time;
};
struct wlr_touch_point {