summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-02-22 16:27:05 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-02-22 16:27:05 +0100
commit9bbf38540e13b326ac16bc152446c3c64ca20a06 (patch)
tree6dfab48de4beee45bdbd354ad5024894d0b079bc
parentc26c2afc720d615c72acd4f5f3debed285e0dcb8 (diff)
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 <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--src/frame-xi2.c18
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
268const 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
268const struct utouch_frame * 284const struct utouch_frame *
269utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) 285utouch_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) {