From 52d5c11108809a0c09884869400d435a25dbf25a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 31 Oct 2012 19:32:57 +0100 Subject: [PATCH 1/2] Xi: Update the device after delivering the emulated pointer event(#56558) Ensure emulated pointer events contain the state that applies before the event was processed, so the device state must be updated after delivering such emulated events. Co-authored-by: Peter Hutterer Signed-off-by: Carlos Garnacho --- Xi/exevents.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 6ed4991..8a0a702 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1568,9 +1568,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) 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); @@ -1617,6 +1614,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) * events which _only_ emulate motion just work normally */ if (emulate_pointer && ev->any.type != ET_TouchUpdate) DeliverEmulatedMotionEvent(dev, ti, ev); + if (emulate_pointer && IsMaster(dev)) CheckMotion(&ev->device_event, dev); @@ -1641,6 +1639,9 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) if (ev->any.type == ET_TouchEnd) TouchEndTouch(dev, ti); } + + if (emulate_pointer) + UpdateDeviceState(dev, &ev->device_event); } /** -- 1.7.11.7