compinit.c revision 4642e01f
105b261ecSmrg/*
205b261ecSmrg * Copyright © 2006 Sun Microsystems
305b261ecSmrg *
405b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
505b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
605b261ecSmrg * the above copyright notice appear in all copies and that both that
705b261ecSmrg * copyright notice and this permission notice appear in supporting
805b261ecSmrg * documentation, and that the name of Sun Microsystems not be used in
905b261ecSmrg * advertising or publicity pertaining to distribution of the software without
1005b261ecSmrg * specific, written prior permission.  Sun Microsystems makes no
1105b261ecSmrg * representations about the suitability of this software for any purpose.  It
1205b261ecSmrg * is provided "as is" without express or implied warranty.
1305b261ecSmrg *
1405b261ecSmrg * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1505b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1605b261ecSmrg * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1705b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1805b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1905b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2005b261ecSmrg * PERFORMANCE OF THIS SOFTWARE.
2105b261ecSmrg *
2205b261ecSmrg * Copyright © 2003 Keith Packard
2305b261ecSmrg *
2405b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
2505b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
2605b261ecSmrg * the above copyright notice appear in all copies and that both that
2705b261ecSmrg * copyright notice and this permission notice appear in supporting
2805b261ecSmrg * documentation, and that the name of Keith Packard not be used in
2905b261ecSmrg * advertising or publicity pertaining to distribution of the software without
3005b261ecSmrg * specific, written prior permission.  Keith Packard makes no
3105b261ecSmrg * representations about the suitability of this software for any purpose.  It
3205b261ecSmrg * is provided "as is" without express or implied warranty.
3305b261ecSmrg *
3405b261ecSmrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
3505b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
3605b261ecSmrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
3705b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
3805b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
3905b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4005b261ecSmrg * PERFORMANCE OF THIS SOFTWARE.
4105b261ecSmrg */
4205b261ecSmrg
4305b261ecSmrg#ifdef HAVE_DIX_CONFIG_H
4405b261ecSmrg#include <dix-config.h>
4505b261ecSmrg#endif
4605b261ecSmrg
4705b261ecSmrg#include "compint.h"
4805b261ecSmrg
494642e01fSmrgstatic int CompScreenPrivateKeyIndex;
504642e01fSmrgDevPrivateKey CompScreenPrivateKey = &CompScreenPrivateKeyIndex;
514642e01fSmrgstatic int CompWindowPrivateKeyIndex;
524642e01fSmrgDevPrivateKey CompWindowPrivateKey = &CompWindowPrivateKeyIndex;
534642e01fSmrgstatic int CompSubwindowsPrivateKeyIndex;
544642e01fSmrgDevPrivateKey CompSubwindowsPrivateKey = &CompSubwindowsPrivateKeyIndex;
5505b261ecSmrg
5605b261ecSmrg
5705b261ecSmrgstatic Bool
5805b261ecSmrgcompCloseScreen (int index, ScreenPtr pScreen)
5905b261ecSmrg{
6005b261ecSmrg    CompScreenPtr   cs = GetCompScreen (pScreen);
6105b261ecSmrg    Bool	    ret;
6205b261ecSmrg
6305b261ecSmrg    xfree (cs->alternateVisuals);
6405b261ecSmrg
6505b261ecSmrg    pScreen->CloseScreen = cs->CloseScreen;
6605b261ecSmrg    pScreen->BlockHandler = cs->BlockHandler;
6705b261ecSmrg    pScreen->InstallColormap = cs->InstallColormap;
684642e01fSmrg    pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
6905b261ecSmrg    pScreen->ReparentWindow = cs->ReparentWindow;
7005b261ecSmrg    pScreen->MoveWindow = cs->MoveWindow;
7105b261ecSmrg    pScreen->ResizeWindow = cs->ResizeWindow;
7205b261ecSmrg    pScreen->ChangeBorderWidth = cs->ChangeBorderWidth;
7305b261ecSmrg
7405b261ecSmrg    pScreen->ClipNotify = cs->ClipNotify;
7505b261ecSmrg    pScreen->UnrealizeWindow = cs->UnrealizeWindow;
7605b261ecSmrg    pScreen->RealizeWindow = cs->RealizeWindow;
7705b261ecSmrg    pScreen->DestroyWindow = cs->DestroyWindow;
7805b261ecSmrg    pScreen->CreateWindow = cs->CreateWindow;
7905b261ecSmrg    pScreen->CopyWindow = cs->CopyWindow;
8005b261ecSmrg    pScreen->PositionWindow = cs->PositionWindow;
8105b261ecSmrg
8205b261ecSmrg    xfree (cs);
834642e01fSmrg    dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
8405b261ecSmrg    ret = (*pScreen->CloseScreen) (index, pScreen);
8505b261ecSmrg
8605b261ecSmrg    return ret;
8705b261ecSmrg}
8805b261ecSmrg
8905b261ecSmrgstatic void
9005b261ecSmrgcompInstallColormap (ColormapPtr pColormap)
9105b261ecSmrg{
9205b261ecSmrg    VisualPtr	    pVisual = pColormap->pVisual;
9305b261ecSmrg    ScreenPtr	    pScreen = pColormap->pScreen;
9405b261ecSmrg    CompScreenPtr   cs = GetCompScreen (pScreen);
9505b261ecSmrg    int		    a;
9605b261ecSmrg
9705b261ecSmrg    for (a = 0; a < cs->numAlternateVisuals; a++)
9805b261ecSmrg	if (pVisual->vid == cs->alternateVisuals[a])
9905b261ecSmrg	    return;
10005b261ecSmrg    pScreen->InstallColormap = cs->InstallColormap;
10105b261ecSmrg    (*pScreen->InstallColormap) (pColormap);
10205b261ecSmrg    cs->InstallColormap = pScreen->InstallColormap;
10305b261ecSmrg    pScreen->InstallColormap = compInstallColormap;
10405b261ecSmrg}
10505b261ecSmrg
1064642e01fSmrg/* Fake backing store via automatic redirection */
1074642e01fSmrgstatic Bool
1084642e01fSmrgcompChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
1094642e01fSmrg{
1104642e01fSmrg    ScreenPtr pScreen = pWin->drawable.pScreen;
1114642e01fSmrg    CompScreenPtr cs = GetCompScreen (pScreen);
1124642e01fSmrg    Bool ret;
1134642e01fSmrg
1144642e01fSmrg    pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
1154642e01fSmrg    ret = pScreen->ChangeWindowAttributes(pWin, mask);
1164642e01fSmrg
1174642e01fSmrg    if (ret && (mask & CWBackingStore) &&
1184642e01fSmrg	    pScreen->backingStoreSupport != NotUseful) {
1194642e01fSmrg	if (pWin->backingStore != NotUseful) {
1204642e01fSmrg	    compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
1214642e01fSmrg	    pWin->backStorage = (pointer) (intptr_t) 1;
1224642e01fSmrg	} else {
1234642e01fSmrg	    compUnredirectWindow(serverClient, pWin,
1244642e01fSmrg				 CompositeRedirectAutomatic);
1254642e01fSmrg	    pWin->backStorage = NULL;
1264642e01fSmrg	}
1274642e01fSmrg    }
1284642e01fSmrg
1294642e01fSmrg    pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
1304642e01fSmrg
1314642e01fSmrg    return ret;
1324642e01fSmrg}
1334642e01fSmrg
13405b261ecSmrgstatic void
13505b261ecSmrgcompScreenUpdate (ScreenPtr pScreen)
13605b261ecSmrg{
13705b261ecSmrg    CompScreenPtr   cs = GetCompScreen (pScreen);
13805b261ecSmrg
13905b261ecSmrg    compCheckTree (pScreen);
14005b261ecSmrg    if (cs->damaged)
14105b261ecSmrg    {
14205b261ecSmrg	compWindowUpdate (WindowTable[pScreen->myNum]);
14305b261ecSmrg	cs->damaged = FALSE;
14405b261ecSmrg    }
14505b261ecSmrg}
14605b261ecSmrg
14705b261ecSmrgstatic void
14805b261ecSmrgcompBlockHandler (int	    i,
14905b261ecSmrg		  pointer   blockData,
15005b261ecSmrg		  pointer   pTimeout,
15105b261ecSmrg		  pointer   pReadmask)
15205b261ecSmrg{
15305b261ecSmrg    ScreenPtr	    pScreen = screenInfo.screens[i];
15405b261ecSmrg    CompScreenPtr   cs = GetCompScreen (pScreen);
15505b261ecSmrg
15605b261ecSmrg    pScreen->BlockHandler = cs->BlockHandler;
15705b261ecSmrg    compScreenUpdate (pScreen);
15805b261ecSmrg    (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
15905b261ecSmrg    cs->BlockHandler = pScreen->BlockHandler;
16005b261ecSmrg    pScreen->BlockHandler = compBlockHandler;
16105b261ecSmrg}
16205b261ecSmrg
16305b261ecSmrg/*
16405b261ecSmrg * Add alternate visuals -- always expose an ARGB32 and RGB24 visual
16505b261ecSmrg */
16605b261ecSmrg
16705b261ecSmrgstatic DepthPtr
16805b261ecSmrgcompFindVisuallessDepth (ScreenPtr pScreen, int d)
16905b261ecSmrg{
17005b261ecSmrg    int		i;
17105b261ecSmrg
17205b261ecSmrg    for (i = 0; i < pScreen->numDepths; i++)
17305b261ecSmrg    {
17405b261ecSmrg	DepthPtr    depth = &pScreen->allowedDepths[i];
17505b261ecSmrg	if (depth->depth == d)
17605b261ecSmrg	{
17705b261ecSmrg	    /*
17805b261ecSmrg	     * Make sure it doesn't have visuals already
17905b261ecSmrg	     */
18005b261ecSmrg	    if (depth->numVids)
18105b261ecSmrg		return 0;
18205b261ecSmrg	    /*
18305b261ecSmrg	     * looks fine
18405b261ecSmrg	     */
18505b261ecSmrg	    return depth;
18605b261ecSmrg	}
18705b261ecSmrg    }
18805b261ecSmrg    /*
18905b261ecSmrg     * If there isn't one, then it's gonna be hard to have
19005b261ecSmrg     * an associated visual
19105b261ecSmrg     */
19205b261ecSmrg    return 0;
19305b261ecSmrg}
19405b261ecSmrg
19505b261ecSmrg/*
19605b261ecSmrg * Add a list of visual IDs to the list of visuals to implicitly redirect.
19705b261ecSmrg */
19805b261ecSmrgstatic Bool
19905b261ecSmrgcompRegisterAlternateVisuals (CompScreenPtr cs, VisualID *vids, int nVisuals)
20005b261ecSmrg{
20105b261ecSmrg    VisualID *p;
20205b261ecSmrg
20305b261ecSmrg    p = xrealloc(cs->alternateVisuals,
20405b261ecSmrg		 sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
20505b261ecSmrg    if(p == NULL)
20605b261ecSmrg	return FALSE;
20705b261ecSmrg
20805b261ecSmrg    memcpy(&p[cs->numAlternateVisuals], vids, sizeof(VisualID) * nVisuals);
20905b261ecSmrg
21005b261ecSmrg    cs->alternateVisuals = p;
21105b261ecSmrg    cs->numAlternateVisuals += nVisuals;
21205b261ecSmrg
21305b261ecSmrg    return TRUE;
21405b261ecSmrg}
21505b261ecSmrg
21605b261ecSmrg_X_EXPORT
21705b261ecSmrgBool CompositeRegisterAlternateVisuals (ScreenPtr pScreen, VisualID *vids,
21805b261ecSmrg					int nVisuals)
21905b261ecSmrg{
22005b261ecSmrg    CompScreenPtr cs = GetCompScreen (pScreen);
22105b261ecSmrg    return compRegisterAlternateVisuals(cs, vids, nVisuals);
22205b261ecSmrg}
22305b261ecSmrg
22405b261ecSmrgtypedef struct _alternateVisual {
22505b261ecSmrg    int		depth;
22605b261ecSmrg    CARD32	format;
22705b261ecSmrg} CompAlternateVisual;
22805b261ecSmrg
22905b261ecSmrgstatic CompAlternateVisual  altVisuals[] = {
23005b261ecSmrg#if COMP_INCLUDE_RGB24_VISUAL
23105b261ecSmrg    {	24,	PICT_r8g8b8 },
23205b261ecSmrg#endif
23305b261ecSmrg    {	32,	PICT_a8r8g8b8 },
23405b261ecSmrg};
23505b261ecSmrg
23605b261ecSmrgstatic const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) /
23705b261ecSmrg					      sizeof(CompAlternateVisual);
23805b261ecSmrg
23905b261ecSmrgstatic Bool
24005b261ecSmrgcompAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
24105b261ecSmrg		       CompAlternateVisual *alt)
24205b261ecSmrg{
24305b261ecSmrg    VisualPtr	    visual, visuals;
24405b261ecSmrg    int		    i;
24505b261ecSmrg    int		    numVisuals;
24605b261ecSmrg    XID		    *installedCmaps;
24705b261ecSmrg    ColormapPtr	    installedCmap;
24805b261ecSmrg    int		    numInstalledCmaps;
24905b261ecSmrg    DepthPtr	    depth;
25005b261ecSmrg    PictFormatPtr   pPictFormat;
25105b261ecSmrg    VisualID	    *vid;
25205b261ecSmrg    unsigned long   alphaMask;
25305b261ecSmrg
25405b261ecSmrg    /*
25505b261ecSmrg     * The ARGB32 visual is always available.  Other alternate depth visuals
25605b261ecSmrg     * are only provided if their depth is less than the root window depth.
25705b261ecSmrg     * There's no deep reason for this.
25805b261ecSmrg     */
25905b261ecSmrg    if (alt->depth >= pScreen->rootDepth && alt->depth != 32)
26005b261ecSmrg	return FALSE;
26105b261ecSmrg
26205b261ecSmrg    depth = compFindVisuallessDepth (pScreen, alt->depth);
26305b261ecSmrg    if (!depth)
26405b261ecSmrg	/* alt->depth doesn't exist or already has alternate visuals. */
26505b261ecSmrg	return TRUE;
26605b261ecSmrg
26705b261ecSmrg    pPictFormat = PictureMatchFormat (pScreen, alt->depth, alt->format);
26805b261ecSmrg    if (!pPictFormat)
26905b261ecSmrg	return FALSE;
27005b261ecSmrg
27105b261ecSmrg    vid = xalloc(sizeof(VisualID));
27205b261ecSmrg    if (!vid)
27305b261ecSmrg	return FALSE;
27405b261ecSmrg
27505b261ecSmrg    /* Find the installed colormaps */
27605b261ecSmrg    installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
27705b261ecSmrg    if (!installedCmaps) {
27805b261ecSmrg	xfree(vid);
27905b261ecSmrg	return FALSE;
28005b261ecSmrg    }
28105b261ecSmrg    numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen,
28205b261ecSmrg	    installedCmaps);
28305b261ecSmrg
28405b261ecSmrg    /* realloc the visual array to fit the new one in place */
28505b261ecSmrg    numVisuals = pScreen->numVisuals;
28605b261ecSmrg    visuals = xrealloc(pScreen->visuals, (numVisuals + 1) * sizeof(VisualRec));
28705b261ecSmrg    if (!visuals) {
28805b261ecSmrg	xfree(vid);
28905b261ecSmrg	xfree(installedCmaps);
29005b261ecSmrg	return FALSE;
29105b261ecSmrg    }
29205b261ecSmrg
29305b261ecSmrg    /*
29405b261ecSmrg     * Fix up any existing installed colormaps -- we'll assume that
29505b261ecSmrg     * the only ones created so far have been installed.  If this
29605b261ecSmrg     * isn't true, we'll have to walk the resource database looking
29705b261ecSmrg     * for all colormaps.
29805b261ecSmrg     */
29905b261ecSmrg    for (i = 0; i < numInstalledCmaps; i++) {
30005b261ecSmrg	int j;
30105b261ecSmrg
30205b261ecSmrg	installedCmap = LookupIDByType (installedCmaps[i], RT_COLORMAP);
30305b261ecSmrg	if (!installedCmap)
30405b261ecSmrg	    continue;
30505b261ecSmrg	j = installedCmap->pVisual - pScreen->visuals;
30605b261ecSmrg	installedCmap->pVisual = &visuals[j];
30705b261ecSmrg    }
30805b261ecSmrg
30905b261ecSmrg    xfree(installedCmaps);
31005b261ecSmrg
31105b261ecSmrg    pScreen->visuals = visuals;
31205b261ecSmrg    visual = visuals + pScreen->numVisuals; /* the new one */
31305b261ecSmrg    pScreen->numVisuals++;
31405b261ecSmrg
31505b261ecSmrg    /* Initialize the visual */
31605b261ecSmrg    visual->vid = FakeClientID (0);
31705b261ecSmrg    visual->bitsPerRGBValue = 8;
31805b261ecSmrg    if (PICT_FORMAT_TYPE(alt->format) == PICT_TYPE_COLOR) {
31905b261ecSmrg	visual->class = PseudoColor;
32005b261ecSmrg	visual->nplanes = PICT_FORMAT_BPP(alt->format);
32105b261ecSmrg	visual->ColormapEntries = 1 << visual->nplanes;
32205b261ecSmrg    } else {
32305b261ecSmrg	DirectFormatRec *direct = &pPictFormat->direct;
32405b261ecSmrg	visual->class = TrueColor;
32505b261ecSmrg	visual->redMask   = ((unsigned long)direct->redMask) << direct->red;
32605b261ecSmrg	visual->greenMask = ((unsigned long)direct->greenMask) << direct->green;
32705b261ecSmrg	visual->blueMask  = ((unsigned long)direct->blueMask) << direct->blue;
32805b261ecSmrg	alphaMask = ((unsigned long)direct->alphaMask) << direct->alpha;
32905b261ecSmrg	visual->offsetRed   = direct->red;
33005b261ecSmrg	visual->offsetGreen = direct->green;
33105b261ecSmrg	visual->offsetBlue  = direct->blue;
33205b261ecSmrg	/*
33305b261ecSmrg	 * Include A bits in this (unlike GLX which includes only RGB)
33405b261ecSmrg	 * This lets DIX compute suitable masks for colormap allocations
33505b261ecSmrg	 */
33605b261ecSmrg	visual->nplanes = Ones (visual->redMask |
33705b261ecSmrg		visual->greenMask |
33805b261ecSmrg		visual->blueMask |
33905b261ecSmrg		alphaMask);
34005b261ecSmrg	/* find widest component */
34105b261ecSmrg	visual->ColormapEntries = (1 << max (Ones (visual->redMask),
34205b261ecSmrg		    max (Ones (visual->greenMask),
34305b261ecSmrg			Ones (visual->blueMask))));
34405b261ecSmrg    }
34505b261ecSmrg
34605b261ecSmrg    /* remember the visual ID to detect auto-update windows */
34705b261ecSmrg    compRegisterAlternateVisuals(cs, &visual->vid, 1);
34805b261ecSmrg
34905b261ecSmrg    /* Fix up the depth */
35005b261ecSmrg    *vid = visual->vid;
35105b261ecSmrg    depth->numVids = 1;
35205b261ecSmrg    depth->vids = vid;
35305b261ecSmrg    return TRUE;
35405b261ecSmrg}
35505b261ecSmrg
35605b261ecSmrgstatic Bool
35705b261ecSmrgcompAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
35805b261ecSmrg{
35905b261ecSmrg    int alt, ret = 0;
36005b261ecSmrg
36105b261ecSmrg    for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++)
36205b261ecSmrg	ret |= compAddAlternateVisual(pScreen, cs, altVisuals + alt);
36305b261ecSmrg
36405b261ecSmrg    return !!ret;
36505b261ecSmrg}
36605b261ecSmrg
36705b261ecSmrgBool
36805b261ecSmrgcompScreenInit (ScreenPtr pScreen)
36905b261ecSmrg{
37005b261ecSmrg    CompScreenPtr   cs;
37105b261ecSmrg
37205b261ecSmrg    if (GetCompScreen (pScreen))
37305b261ecSmrg	return TRUE;
37405b261ecSmrg    cs = (CompScreenPtr) xalloc (sizeof (CompScreenRec));
37505b261ecSmrg    if (!cs)
37605b261ecSmrg	return FALSE;
37705b261ecSmrg
37805b261ecSmrg    cs->damaged = FALSE;
3794642e01fSmrg    cs->overlayWid = FakeClientID(0);
38005b261ecSmrg    cs->pOverlayWin = NULL;
38105b261ecSmrg    cs->pOverlayClients = NULL;
38205b261ecSmrg
38305b261ecSmrg    cs->numAlternateVisuals = 0;
38405b261ecSmrg    cs->alternateVisuals = NULL;
38505b261ecSmrg
38605b261ecSmrg    if (!compAddAlternateVisuals (pScreen, cs))
38705b261ecSmrg    {
38805b261ecSmrg	xfree (cs);
38905b261ecSmrg	return FALSE;
39005b261ecSmrg    }
39105b261ecSmrg
39205b261ecSmrg    cs->PositionWindow = pScreen->PositionWindow;
39305b261ecSmrg    pScreen->PositionWindow = compPositionWindow;
39405b261ecSmrg
39505b261ecSmrg    cs->CopyWindow = pScreen->CopyWindow;
39605b261ecSmrg    pScreen->CopyWindow = compCopyWindow;
39705b261ecSmrg
39805b261ecSmrg    cs->CreateWindow = pScreen->CreateWindow;
39905b261ecSmrg    pScreen->CreateWindow = compCreateWindow;
40005b261ecSmrg
40105b261ecSmrg    cs->DestroyWindow = pScreen->DestroyWindow;
40205b261ecSmrg    pScreen->DestroyWindow = compDestroyWindow;
40305b261ecSmrg
40405b261ecSmrg    cs->RealizeWindow = pScreen->RealizeWindow;
40505b261ecSmrg    pScreen->RealizeWindow = compRealizeWindow;
40605b261ecSmrg
40705b261ecSmrg    cs->UnrealizeWindow = pScreen->UnrealizeWindow;
40805b261ecSmrg    pScreen->UnrealizeWindow = compUnrealizeWindow;
40905b261ecSmrg
41005b261ecSmrg    cs->ClipNotify = pScreen->ClipNotify;
41105b261ecSmrg    pScreen->ClipNotify = compClipNotify;
41205b261ecSmrg
41305b261ecSmrg    cs->MoveWindow = pScreen->MoveWindow;
41405b261ecSmrg    pScreen->MoveWindow = compMoveWindow;
41505b261ecSmrg
41605b261ecSmrg    cs->ResizeWindow = pScreen->ResizeWindow;
41705b261ecSmrg    pScreen->ResizeWindow = compResizeWindow;
41805b261ecSmrg
41905b261ecSmrg    cs->ChangeBorderWidth = pScreen->ChangeBorderWidth;
42005b261ecSmrg    pScreen->ChangeBorderWidth = compChangeBorderWidth;
42105b261ecSmrg
42205b261ecSmrg    cs->ReparentWindow = pScreen->ReparentWindow;
42305b261ecSmrg    pScreen->ReparentWindow = compReparentWindow;
42405b261ecSmrg
42505b261ecSmrg    cs->InstallColormap = pScreen->InstallColormap;
42605b261ecSmrg    pScreen->InstallColormap = compInstallColormap;
42705b261ecSmrg
4284642e01fSmrg    cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
4294642e01fSmrg    pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
4304642e01fSmrg
43105b261ecSmrg    cs->BlockHandler = pScreen->BlockHandler;
43205b261ecSmrg    pScreen->BlockHandler = compBlockHandler;
43305b261ecSmrg
43405b261ecSmrg    cs->CloseScreen = pScreen->CloseScreen;
43505b261ecSmrg    pScreen->CloseScreen = compCloseScreen;
43605b261ecSmrg
4374642e01fSmrg    dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs);
43805b261ecSmrg
43905b261ecSmrg    RegisterRealChildHeadProc(CompositeRealChildHead);
44005b261ecSmrg
44105b261ecSmrg    return TRUE;
44205b261ecSmrg}
443