summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--composite/compinit.c24
-rw-r--r--composite/compint.h7
-rw-r--r--composite/compositeext.h4
-rw-r--r--composite/compwindow.c18
4 files changed, 53 insertions, 0 deletions
diff --git a/composite/compinit.c b/composite/compinit.c
index 1db9e0bf5..48e938fac 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -229,6 +229,28 @@ CompositeRegisterAlternateVisuals(ScreenPtr pScreen, VisualID * vids,
return compRegisterAlternateVisuals(cs, vids, nVisuals);
}
+Bool
+CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
+ VisualID parentVisual,
+ VisualID winVisual)
+{
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ CompImplicitRedirectException *p;
+
+ p = realloc(cs->implicitRedirectExceptions,
+ sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1));
+ if (p == NULL)
+ return FALSE;
+
+ p[cs->numImplicitRedirectExceptions].parentVisual = parentVisual;
+ p[cs->numImplicitRedirectExceptions].winVisual = winVisual;
+
+ cs->implicitRedirectExceptions = p;
+ cs->numImplicitRedirectExceptions++;
+
+ return TRUE;
+}
+
typedef struct _alternateVisual {
int depth;
CARD32 format;
@@ -349,6 +371,8 @@ compScreenInit(ScreenPtr pScreen)
cs->numAlternateVisuals = 0;
cs->alternateVisuals = NULL;
+ cs->numImplicitRedirectExceptions = 0;
+ cs->implicitRedirectExceptions = NULL;
if (!compAddAlternateVisuals(pScreen, cs)) {
free(cs);
diff --git a/composite/compint.h b/composite/compint.h
index 12dc8b3f7..56b76c540 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -119,6 +119,11 @@ typedef struct _CompOverlayClientRec {
XID resource;
} CompOverlayClientRec;
+typedef struct _CompImplicitRedirectException {
+ XID parentVisual;
+ XID winVisual;
+} CompImplicitRedirectException;
+
typedef struct _CompScreen {
PositionWindowProcPtr PositionWindow;
CopyWindowProcPtr CopyWindow;
@@ -155,6 +160,8 @@ typedef struct _CompScreen {
CloseScreenProcPtr CloseScreen;
int numAlternateVisuals;
VisualID *alternateVisuals;
+ int numImplicitRedirectExceptions;
+ CompImplicitRedirectException *implicitRedirectExceptions;
WindowPtr pOverlayWin;
Window overlayWid;
diff --git a/composite/compositeext.h b/composite/compositeext.h
index 0b148f029..b96cb1d68 100644
--- a/composite/compositeext.h
+++ b/composite/compositeext.h
@@ -35,6 +35,10 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
VisualID * vids,
int nVisuals);
+extern _X_EXPORT Bool CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
+ VisualID parentVisual,
+ VisualID winVisual);
+
extern _X_EXPORT RESTYPE CompositeClientWindowType;
#endif /* _COMPOSITEEXT_H_ */
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 6c2434959..882429414 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -336,6 +336,21 @@ compIsAlternateVisual(ScreenPtr pScreen, XID visual)
}
static Bool
+compIsImplicitRedirectException(ScreenPtr pScreen,
+ XID parentVisual, XID winVisual)
+{
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ int i;
+
+ for (i = 0; i < cs->numImplicitRedirectExceptions; i++)
+ if (cs->implicitRedirectExceptions[i].parentVisual == parentVisual &&
+ cs->implicitRedirectExceptions[i].winVisual == winVisual)
+ return TRUE;
+
+ return FALSE;
+}
+
+static Bool
compImplicitRedirect(WindowPtr pWin, WindowPtr pParent)
{
if (pParent) {
@@ -343,6 +358,9 @@ compImplicitRedirect(WindowPtr pWin, WindowPtr pParent)
XID winVisual = wVisual(pWin);
XID parentVisual = wVisual(pParent);
+ if (compIsImplicitRedirectException(pScreen, parentVisual, winVisual))
+ return FALSE;
+
if (winVisual != parentVisual &&
(compIsAlternateVisual(pScreen, winVisual) ||
compIsAlternateVisual(pScreen, parentVisual)))