diff --git a/dix/dispatch.c b/dix/dispatch.c index d44687e..1113800 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3566,6 +3566,8 @@ CloseDownClient(register ClientPtr client) } BITCLEAR(grabWaiters, client->index); DeleteClientFromAnySelections(client); + + ReleasePassiveGrabs(client); ReleaseActiveGrabs(client); DeleteClientFontStuff(client); if (!really_close_down) diff --git a/dix/events.c b/dix/events.c index 0053f42..449bc0e 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1484,6 +1484,28 @@ ProcAllowEvents(register ClientPtr client) return Success; } +static +int ReleasePassiveGrabsForWindowIfClient(WindowPtr pWin, pointer data) +{ + ClientPtr client; + GrabPtr g; + + client = data; + + for (g = wPassiveGrabs(pWin); g; g = g->next) + { + if (SameClient(g,client)) + DeletePassiveGrabFromList(g); + } + return WT_WALKCHILDREN; +} + +void +ReleasePassiveGrabs(ClientPtr client) +{ + WalkTree(client->lastDrawable->pScreen, ReleasePassiveGrabsForWindowIfClient, client); +} + void ReleaseActiveGrabs(ClientPtr client) { diff --git a/include/dix.h b/include/dix.h index 5c2c5b8..af6d93f 100644 --- a/include/dix.h +++ b/include/dix.h @@ -467,6 +467,9 @@ extern void AllowSome( extern void ReleaseActiveGrabs( ClientPtr client); +extern void ReleasePassiveGrabs( + ClientPtr client); + extern int DeliverEventsToWindow( WindowPtr /* pWin */, xEventPtr /* pEvents */,