Commit 00cf1c40 authored by Chase Douglas's avatar Chase Douglas Committed by Chase Douglas

Replay original touch begin event instead of generated begin event

The generated event does not have axes other than X and Y and has a
newer timestamp. In particular, the newer timestamp may be newer than
the real touch end event, which may be stuck in the syncEvents queue. If
a client uses the timestamps for grabbing bad things may happen.
Signed-off-by: default avatarChase Douglas <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
parent 312910b4
......@@ -474,10 +474,22 @@ TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource)
if (ti->emulate_pointer)
/* send fake begin event to next owner */
/* Generate events based on a fake touch begin event to get DCCE events if
* needed */
/* FIXME: This needs to be cleaned up */
nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchBegin, flags, mask);
for (i = 0; i < nev; i++)
DeliverTouchEvents(dev, ti, tel + i, resource);
for (i = 0; i < nev; i++) {
/* Send saved touch begin event */
if (tel[i].any.type == ET_TouchBegin) {
DeviceEvent *ev = &ti->history[0];
ev->flags |= TOUCH_REPLAYING;
DeliverTouchEvents(dev, ti, (InternalEvent*)ev, resource);
else {/* Send DCCE event */
tel[i].any.time = ti->history[0].time;
DeliverTouchEvents(dev, ti, tel + i, resource);
FreeEventList(tel, GetMaximumEventsNum());
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment