summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorJoel Bosveld <Joel.Bosveld@gmail.com>2009-07-17 11:17:23 +0800
committerJoel Bosveld <Joel.Bosveld@gmail.com>2009-07-17 11:56:55 +0800
commit8f10433fa5d5c340359012a11f91a3c5cc693ae2 (patch)
treedb0666c9526a70ced35c489397752f78d5e23f20 /composite
parentd1761b7f171692f37e50961d9d0a839f745844e4 (diff)
composite: correctly update the unredirected window during grabs
Diffstat (limited to 'composite')
-rw-r--r--composite/compwindow.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index a79ef50aa..8e9a04200 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -1248,21 +1248,30 @@ CompositeGetRedirectedWindowInput (DeviceIntPtr pDev,
WindowPtr pWin)
{
CompClientIRWindowPtr cciw = GetCompClientIRWindow (pWin);
-
+ WindowPtr pGrabWin = pDev->deviceGrab.grab ?
+ pDev->deviceGrab.grab->window : NULL;
/* During a grab we don't want to update the unredirectedWindow, but just
- * keep using the one that was being used when grab activated
+ * keep using the one that was being used when grab activated. However, if
+ * the window isn't part of the hierachy of the grabbed window, we should
+ * update it anyways, in order to have the expected behaviour.
*/
+ Bool update = pGrabWin ? !(IsParent (pWin, pGrabWin) ||
+ IsParent (pGrabWin, pWin)) : TRUE;
+
if (cciw && cciw->pDest)
{
CompIRWindowPtr ciw = GetCompIRWindow (cciw->pDest);
- if (!pDev->deviceGrab.grab)
+ /* We also need to check that the dest window isn't */
+ update = update && pGrabWin ? !(IsParent (cciw->pDest, pGrabWin) ||
+ IsParent (pGrabWin, cciw->pDest)) : TRUE;
+ if (update)
ciw->unredirectedWindow[pDev->id] = pWin;
return cciw->pDest;
}
else
{
CompIRWindowPtr ciw = GetCompIRWindow (pWin);
- if (ciw && !pDev->deviceGrab.grab)
+ if (ciw && update)
ciw->unredirectedWindow[pDev->id] = NULL;
return pWin;
}