--- xgl-orig/xserver-xgl-7.0.0/hw/xgl/glx/xglx.c 2006-04-03 16:57:13.000000000 -0300 +++ xgl-modif/xserver-xgl-7.0.0/hw/xgl/glx/xglx.c 2006-04-03 16:57:59.000000000 -0300 @@ -551,6 +551,40 @@ return TRUE; } +Bool +xglxCreateColormap(ScreenPtr pScreen) +{ + VisualPtr pVisual; + ColormapPtr pCmap; + unsigned short zero = 0, ones = 0xFFFF; +/* Pixel wp, bp; */ + + for (pVisual = pScreen->visuals; + pVisual->vid != pScreen->rootVisual; + pVisual++); + if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &pCmap, + (pVisual->class & DynamicClass) ? AllocNone : AllocAll, + 0) + != Success) + return False; + + +/* wp = pScreen->whitePixel; + bp = pScreen->blackPixel; + if ((AllocColor(pCmap, &ones, &ones, &ones, &wp, 0) != + Success) || + (AllocColor(pCmap, &zero, &zero, &zero, &bp, 0) != + Success)) + return FALSE; + pScreen->whitePixel = wp; + pScreen->blackPixel = bp; +*/ + (*pScreen->InstallColormap)(pCmap); /* miSpriteInstallColormap(pCmap); */ + + return True; +} + + static Bool xglxCloseScreen (int index, ScreenPtr pScreen) @@ -794,6 +828,8 @@ XFreeColors (xdisplay, pScreenPriv->colormap, &black.pixel, 1, 0); miDCInitialize (pScreen, &xglxPointerScreenFuncs); + + if (!xglxCreateColormap(pScreen)) return FALSE; } else {