diff options
-rw-r--r-- | composite/compext.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/composite/compext.c b/composite/compext.c index b3877e98f..53178b8d8 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -428,7 +428,7 @@ ProcCompositeSetTriangularCoordinateMesh (ClientPtr client) static int ProcCompositeRedirectWindowInput (ClientPtr client) { - WindowPtr pWin, pDest; + WindowPtr pWin, pDest, pTmp; CompClientIRWindowPtr cciw; CompIRWindowPtr diw; int status; @@ -441,8 +441,12 @@ ProcCompositeRedirectWindowInput (ClientPtr client) VERIFY_WINDOW(pDest, stuff->destination, client, DixSetAttrAccess|DixManageAccess|DixBlendAccess); - /* XXX check that pWin isn't an ancestor of pDest + /* Check that pDest isn't an ancestor of pWin + * start from pWin->parent because if pWin == pDest we unset redirection */ + for (pTmp = pWin->parent; pTmp; pTmp = pTmp->parent) + if (pTmp == pDest) + return BadWindow; cciw = GetCompClientIRWindow (pWin); diw = GetCompIRWindow (pDest); |