From 9bbf38540e13b326ac16bc152446c3c64ca20a06 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 22 Feb 2011 16:27:05 +0100 Subject: Disable time-dependent filtering for current XI2.1 Velocity-adjusted positioning and Kalman filters depend on accurate time stamps on events. Until we have device event times, disable this functionality for XI2.1 Tested-by: Chase Douglas Signed-off-by: Henrik Rydberg --- src/frame-xi2.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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, return 1; } +const struct utouch_frame *sync_xi2(utouch_frame_handle fh, + utouch_frame_time_t time) +{ + struct utouch_frame *next = fh->next; + int i; + + /* no velocity adjustments without device time stamps in place */ + for (i = 0; i < fh->num_slots; i++) { + struct utouch_contact *q = next->slots[i]; + q->vx = 0; + q->vy = 0; + } + + return utouch_frame_sync(fh, time); +} + const struct utouch_frame * utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) { @@ -292,7 +308,7 @@ utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) handle_event(fh, slot, i, value[num++]); if (ev->evtype == XI_TouchEnd) utouch_frame_get_current_slot(fh)->id = -1; - return utouch_frame_sync(fh, ev->time); + return sync_xi2(fh, ev->time); case XI_PropertyEvent: prop_ev = (XIPropertyEvent *)ev; if (prop_ev->property == transform_atom && ev->display) { -- cgit v1.2.3