From a2a10e9ad51fe2b24024a49db1fb6ef1272c4bec Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 28 Feb 2013 13:04:36 +1000 Subject: [PATCH 10/35] Xi: fix lookup in ActivateEarlyAccept ActivateEarlyAccept() can only be called from a grabbing client, so we can ignore the rest. And it's easy enough to get the client from that since 9ad0fdb135a1c336771aee1f6eab75a6ad874aff. Signed-off-by: Peter Hutterer (cherry picked from commit 8b0d21044956f3810199d5e2f38ce33069e97be7) --- Xi/exevents.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 99bc595..f3fd697 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1039,17 +1039,16 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti) int rc; ClientPtr client; XID error; + GrabPtr grab = ti->listeners[0].grab; - rc = dixLookupClient(&client, ti->listeners[0].listener, serverClient, - DixSendAccess); - if (rc != Success) { - ErrorF("[Xi] Failed to lookup early accepting client.\n"); - return; - } + BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && + ti->listeners[0].type != LISTENER_POINTER_GRAB); + BUG_RETURN(!grab); + + client = rClient(grab); if (TouchAcceptReject(client, dev, XIAcceptTouch, ti->client_id, - ti->listeners[0].window->drawable.id, &error) != - Success) + ti->listeners[0].window->drawable.id, &error) != Success) ErrorF("[Xi] Failed to accept touch grab after early acceptance.\n"); } -- 1.8.2.1