diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -67,15 +67,29 @@ static Bool dmxSaveScreen(ScreenPtr pScreen, int what); static unsigned long dmxGeneration; static unsigned long *dmxCursorGeneration; -DevPrivateKey dmxGCPrivateKey = &dmxGCPrivateKey; /**< Private index for GCs */ -DevPrivateKey dmxWinPrivateKey = &dmxWinPrivateKey; /**< Private index for Windows */ -DevPrivateKey dmxPixPrivateKey = &dmxPixPrivateKey; /**< Private index for Pixmaps */ +static int dmxGCPrivateKeyIndex; +DevPrivateKey dmxGCPrivateKey = &dmxGCPrivateKeyIndex; /**< Private index for GCs */ + +static int dmxWinPrivateKeyIndex; +DevPrivateKey dmxWinPrivateKey = &dmxWinPrivateKeyIndex; /**< Private index for Windows */ + +static int dmxPixPrivateKeyIndex; +DevPrivateKey dmxPixPrivateKey = &dmxPixPrivateKeyIndex; /**< Private index for Pixmaps */ + int dmxFontPrivateIndex; /**< Private index for Fonts */ -DevPrivateKey dmxScreenPrivateKey = &dmxScreenPrivateKey; /**< Private index for Screens */ -DevPrivateKey dmxColormapPrivateKey = &dmxColormapPrivateKey; /**< Private index for Colormaps */ + +static int dmxScreenPrivateKeyIndex; +DevPrivateKey dmxScreenPrivateKey = &dmxScreenPrivateKeyIndex; /**< Private index for Screens */ + +static int dmxColormapPrivateKeyIndex; +DevPrivateKey dmxColormapPrivateKey = &dmxColormapPrivateKeyIndex; /**< Private index for Colormaps */ #ifdef RENDER -DevPrivateKey dmxPictPrivateKey = &dmxPictPrivateKey; /**< Private index for Picts */ -DevPrivateKey dmxGlyphSetPrivateKey = &dmxGlyphSetPrivateKey; /**< Private index for GlyphSets */ + +static int dmxPictPrivateKeyIndex; +DevPrivateKey dmxPictPrivateKey = &dmxPictPrivateKeyIndex; /**< Private index for Picts */ + +static int dmxGlyphSetPrivateKeyIndex; +DevPrivateKey dmxGlyphSetPrivateKey = &dmxGlyphSetPrivateKeyIndex; /**< Private index for GlyphSets */ #endif /** Initialize the parts of screen \a idx that require access to the diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -85,6 +85,8 @@ static GCOps dmxGCOps = { /** Initialize the GC on \a pScreen */ Bool dmxInitGC(ScreenPtr pScreen) { + if (!dixRequestPrivate(dmxGCPrivateKey, sizeof(dmxGCPrivRec))) + return FALSE; return TRUE; }