diff options
author | marha <marha@users.sourceforge.net> | 2010-05-05 09:43:03 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-05-05 09:43:03 +0000 |
commit | 0874ae23a16946781dd517cfdb011c691ad0b581 (patch) | |
tree | 8de31864935e96a5e59b9fe6ceb12390bbc474cd /xorg-server/hw/xnest | |
parent | d059ebdcb012228102f0b64f8cddf9464d5b625a (diff) | |
download | vcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.tar.gz vcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.tar.bz2 vcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.zip |
svn merge -r571:HEAD "^/branches/released" .
Diffstat (limited to 'xorg-server/hw/xnest')
-rw-r--r-- | xorg-server/hw/xnest/Color.c | 22 |
1 files changed, 9 insertions, 13 deletions
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 |