From 650d418382eae64ce37765c1fbe2693a6c255ddc Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 4 May 2010 07:14:28 +0000 Subject: xserver git update 4/5/2010 --- xorg-server/hw/xnest/Color.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'xorg-server/hw/xnest/Color.c') diff --git a/xorg-server/hw/xnest/Color.c b/xorg-server/hw/xnest/Color.c index dc749478f..2e6de15e4 100644 --- a/xorg-server/hw/xnest/Color.c +++ b/xorg-server/hw/xnest/Color.c @@ -34,7 +34,11 @@ is" without express or implied warranty. #include "XNWindow.h" #include "Args.h" -static ColormapPtr InstalledMaps[MAXSCREENS]; +static int cmapScrPrivateKeyIndex; +static DevPrivateKey cmapScrPrivateKey = &cmapScrPrivateKeyIndex; + +#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey)) +#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c)) Bool xnestCreateColormap(ColormapPtr pCmap) @@ -332,11 +336,7 @@ xnestDirectUninstallColormaps(ScreenPtr pScreen) void xnestInstallColormap(ColormapPtr pCmap) { - int index; - ColormapPtr pOldCmap; - - index = pCmap->pScreen->myNum; - pOldCmap = InstalledMaps[index]; + ColormapPtr pOldCmap = GetInstalledColormap(pCmap->pScreen); if(pCmap != pOldCmap) { @@ -346,7 +346,7 @@ xnestInstallColormap(ColormapPtr pCmap) if(pOldCmap != (ColormapPtr)None) WalkTree(pCmap->pScreen, TellLostMap, (pointer)&pOldCmap->mid); - InstalledMaps[index] = pCmap; + SetInstalledColormap(pCmap->pScreen, pCmap); WalkTree(pCmap->pScreen, TellGainedMap, (pointer)&pCmap->mid); xnestSetInstalledColormapWindows(pCmap->pScreen); @@ -357,11 +357,7 @@ xnestInstallColormap(ColormapPtr pCmap) void xnestUninstallColormap(ColormapPtr pCmap) { - int index; - ColormapPtr pCurCmap; - - index = pCmap->pScreen->myNum; - pCurCmap = InstalledMaps[index]; + ColormapPtr pCurCmap = GetInstalledColormap(pCmap->pScreen); if(pCmap == pCurCmap) { @@ -382,7 +378,7 @@ int xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs) { if (xnestInstalledDefaultColormap) { - *pCmapIDs = InstalledMaps[pScreen->myNum]->mid; + *pCmapIDs = GetInstalledColormap(pScreen)->mid; return 1; } else -- cgit v1.2.3