Commit 5b00fc52 authored by Peter Hutterer's avatar Peter Hutterer

Move TouchListenerGone call to CloseDownClient

TouchListenerGone cleans up if a client disappears. Having this in
FreeGrab() triggers cyclic removal of grabs, emitting wrong events. In
particular, it would clean up a passive grab record while that grab is
active.

Move it to CloseDownClient() instead, cleaning up before we go.
Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 34c9b39d
......@@ -3399,6 +3399,7 @@ CloseDownClient(ClientPtr client)
clientinfo.setup = (xConnSetup *) NULL;
CallCallbacks((&ClientStateCallback), (pointer) &clientinfo);
}
TouchListenerGone(client->clientAsMask);
FreeClientResources(client);
/* Disable client ID tracking. This must be done after
* ClientStateCallback. */
......
......@@ -257,9 +257,6 @@ FreeGrab(GrabPtr pGrab)
{
BUG_RETURN(!pGrab);
if (pGrab->grabtype == XI2 && pGrab->type == XI_TouchBegin)
TouchListenerGone(pGrab->resource);
free(pGrab->modifiersDetail.pMask);
free(pGrab->detail.pMask);
......
......@@ -989,11 +989,11 @@ TouchListenerGone(XID resource)
continue;
for (j = 0; j < ti->num_listeners; j++) {
if (ti->listeners[j].listener != resource)
if (CLIENT_BITS(ti->listeners[j].listener) != resource)
continue;
nev = GetTouchOwnershipEvents(events, dev, ti, XIRejectTouch,
resource, 0);
ti->listeners[j].listener, 0);
for (k = 0; k < nev; k++)
mieqProcessDeviceEvent(dev, events + k, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment