From a986f2f30cbe2a00e72ded7315c4951d7703e549 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Tue, 17 Apr 2012 18:40:15 +0000 Subject: Update device state including when touch record does not exist If a touch is physically active, the pointer core state should reflect that the first button is pressed. Currently, this only occurs when there are active listeners of the touch sequence. By moving the device state updating to the beginning of touch processing we ensure it is updated according to the processed physical state no matter what. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer THIS PATCH IS THE REVERSAL OF THE ABOVE COMMIT! --- diff --git a/Xi/exevents.c b/Xi/exevents.c index e9f0207..d2b088c 100644 --- b/Xi/exevents.c +++ a/Xi/exevents.c @@ -1597,9 +1597,6 @@ else touchid = ev->device_event.touchid; - if (emulate_pointer) - UpdateDeviceState(dev, &ev->device_event); - if (type == ET_TouchBegin) { ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, emulate_pointer); @@ -1999,6 +1996,9 @@ DeliverTouchEvent(dev, ti, ev, listener, client, win, grab, mask); } + + if (ti->emulate_pointer) + UpdateDeviceState(dev, &ev->device_event); } int diff --git a/dix/touch.c b/dix/touch.c index 67c4be2..f8f26c8 100644 --- b/dix/touch.c +++ a/dix/touch.c @@ -364,6 +364,14 @@ { if (ti->emulate_pointer) { GrabPtr grab; + DeviceEvent ev; + + memset(&ev, 0, sizeof(ev)); + ev.type = ET_TouchEnd; + ev.detail.button = 1; + ev.touchid = ti->client_id; + ev.flags = TOUCH_POINTER_EMULATED | TOUCH_END; + UpdateDeviceState(dev, &ev); if ((grab = dev->deviceGrab.grab)) { if (dev->deviceGrab.fromPassiveGrab && +- cgit v0.9.0.2-2-gbebe