From 0addd0d499046fc8a6cdc18fc41d34cac2ba77ea Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Sun, 18 Jul 2004 05:21:20 +0000 Subject: [PATCH] Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=858 - Fixing the problem that clients cannot use the TrueColor visual without calling |XInstallColormap();|. --- Xprint/ps/Ps.h | 1 - Xprint/ps/PsColor.c | 3 --- Xprint/ps/PsGC.c | 8 +++++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h index e8fc615a6..6bde70f47 100644 --- a/Xprint/ps/Ps.h +++ b/Xprint/ps/Ps.h @@ -246,7 +246,6 @@ typedef DisplayListRec *DisplayListPtr; typedef struct { XrmDatabase resDB; - ColormapPtr CMap; Bool (*DestroyWindow)(WindowPtr); } PsScreenPrivRec, *PsScreenPrivPtr; diff --git a/Xprint/ps/PsColor.c b/Xprint/ps/PsColor.c index 9c76904d6..da6c82c1d 100644 --- a/Xprint/ps/PsColor.c +++ b/Xprint/ps/PsColor.c @@ -120,9 +120,6 @@ PsDestroyColormap(ColormapPtr pColor) void PsInstallColormap(ColormapPtr pColor) { - PsScreenPrivPtr pPriv = - (PsScreenPrivPtr)pColor->pScreen->devPrivates[PsScreenPrivateIndex].ptr; - pPriv->CMap = pColor; } void diff --git a/Xprint/ps/PsGC.c b/Xprint/ps/PsGC.c index 28c1f718b..78c83930d 100644 --- a/Xprint/ps/PsGC.c +++ b/Xprint/ps/PsGC.c @@ -156,13 +156,19 @@ PsGetDrawablePrivateStuff( if( pCon==NULL ) return FALSE; else { + Colormap c; + ColormapPtr cmap; + + c = wColormap((WindowPtr)pDrawable); + cmap = (ColormapPtr)LookupIDByType(c, RT_COLORMAP); + cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr; sPriv = (PsScreenPrivPtr) pDrawable->pScreen->devPrivates[PsScreenPrivateIndex].ptr; *gc = cPriv->lastGC; *valid = cPriv->validGC; *psOut = cPriv->pPsOut; - *cMap = sPriv->CMap; + *cMap = cmap; return TRUE; } default: