static double
tp_estimate_delta(int x0, int x1, int x2, int x3)
{
- return (x0 + x1 - x2 - x3) / 4;
+ return (x0 + x1 - x2 - x3) / 4.0;
}
void
for (i = 0; i < tp->ntouches; i++) {
t = tp_get_touch(tp, i);
+
+ /* semi-mt finger postions may "jump" when nfingers changes */
+ if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down)
+ tp_motion_history_reset(t);
+
if (i >= tp->real_touches && t->state != TOUCH_NONE) {
t->x = first->x;
t->y = first->y;
t->dirty = false;
}
+ tp->old_nfingers_down = tp->nfingers_down;
tp->buttons.old_state = tp->buttons.state;
tp->queued = TOUCHPAD_EVENT_NONE;
tp->has_mt = false;
}
+ tp->semi_mt = libevdev_has_property(device->evdev, INPUT_PROP_SEMI_MT);
+
ARRAY_FOR_EACH(max_touches, m) {
if (libevdev_has_event_code(device->evdev,
EV_KEY,
return 0;
}
-
static int
tp_init(struct tp_dispatch *tp,
struct evdev_device *device)
if (tp_init_palmdetect(tp, device) != 0)
return -1;
+ device->seat_caps |= EVDEV_DEVICE_POINTER;
+
return 0;
}