diff options
| -rw-r--r-- | src/frame-xi2.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/frame-xi2.c b/src/frame-xi2.c index 737cff2..5257dab 100644 --- a/src/frame-xi2.c +++ b/src/frame-xi2.c | |||
| @@ -265,6 +265,22 @@ int utouch_frame_configure_xi2(utouch_frame_handle fh, | |||
| 265 | return 1; | 265 | return 1; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | const struct utouch_frame *sync_xi2(utouch_frame_handle fh, | ||
| 269 | utouch_frame_time_t time) | ||
| 270 | { | ||
| 271 | struct utouch_frame *next = fh->next; | ||
| 272 | int i; | ||
| 273 | |||
| 274 | /* no velocity adjustments without device time stamps in place */ | ||
| 275 | for (i = 0; i < fh->num_slots; i++) { | ||
| 276 | struct utouch_contact *q = next->slots[i]; | ||
| 277 | q->vx = 0; | ||
| 278 | q->vy = 0; | ||
| 279 | } | ||
| 280 | |||
| 281 | return utouch_frame_sync(fh, time); | ||
| 282 | } | ||
| 283 | |||
| 268 | const struct utouch_frame * | 284 | const struct utouch_frame * |
| 269 | utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) | 285 | utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) |
| 270 | { | 286 | { |
| @@ -292,7 +308,7 @@ utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) | |||
| 292 | handle_event(fh, slot, i, value[num++]); | 308 | handle_event(fh, slot, i, value[num++]); |
| 293 | if (ev->evtype == XI_TouchEnd) | 309 | if (ev->evtype == XI_TouchEnd) |
| 294 | utouch_frame_get_current_slot(fh)->id = -1; | 310 | utouch_frame_get_current_slot(fh)->id = -1; |
| 295 | return utouch_frame_sync(fh, ev->time); | 311 | return sync_xi2(fh, ev->time); |
| 296 | case XI_PropertyEvent: | 312 | case XI_PropertyEvent: |
| 297 | prop_ev = (XIPropertyEvent *)ev; | 313 | prop_ev = (XIPropertyEvent *)ev; |
| 298 | if (prop_ev->property == transform_atom && ev->display) { | 314 | if (prop_ev->property == transform_atom && ev->display) { |
