mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 21:28:50 +00:00
xnest: Replace use of Colormap->devPriv with standard devPrivates.
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
@@ -34,6 +34,8 @@ is" without express or implied warranty.
|
||||
#include "XNWindow.h"
|
||||
#include "Args.h"
|
||||
|
||||
DevPrivateKeyRec xnestColormapPrivateKeyRec;
|
||||
|
||||
static DevPrivateKeyRec cmapScrPrivateKeyRec;
|
||||
#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
|
||||
|
||||
@@ -52,8 +54,6 @@ xnestCreateColormap(ColormapPtr pCmap)
|
||||
pVisual = pCmap->pVisual;
|
||||
ncolors = pVisual->ColormapEntries;
|
||||
|
||||
pCmap->devPriv = (pointer)malloc(sizeof(xnestPrivColormap));
|
||||
|
||||
xnestColormapPriv(pCmap)->colormap =
|
||||
XCreateColormap(xnestDisplay,
|
||||
xnestDefaultWindows[pCmap->pScreen->myNum],
|
||||
@@ -130,7 +130,6 @@ void
|
||||
xnestDestroyColormap(ColormapPtr pCmap)
|
||||
{
|
||||
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
|
||||
free(pCmap->devPriv);
|
||||
}
|
||||
|
||||
#define SEARCH_PREDICATE \
|
||||
|
||||
@@ -32,8 +32,9 @@ typedef struct {
|
||||
int index;
|
||||
} xnestInstalledColormapWindows;
|
||||
|
||||
extern DevPrivateKeyRec xnestColormapPrivateKeyRec;
|
||||
#define xnestColormapPriv(pCmap) \
|
||||
((xnestPrivColormap *)((pCmap)->devPriv))
|
||||
((xnestPrivColormap *) dixLookupPrivate(&(pCmap)->devPrivates, &xnestColormapPrivateKeyRec))
|
||||
|
||||
#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap)
|
||||
|
||||
|
||||
@@ -151,6 +151,8 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||
return FALSE;
|
||||
if (!dixRegisterPrivateKey(&xnestPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof (xnestPrivPixmap)))
|
||||
return FALSE;
|
||||
if (!dixRegisterPrivateKey(&xnestColormapPrivateKeyRec, PRIVATE_COLORMAP, sizeof (xnestPrivColormap)))
|
||||
return FALSE;
|
||||
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
|
||||
return FALSE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user