summaryrefslogtreecommitdiff
path: root/hw/darwin/quartz/fullscreen/fullscreen.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/darwin/quartz/fullscreen/fullscreen.c')
-rw-r--r--hw/darwin/quartz/fullscreen/fullscreen.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/hw/darwin/quartz/fullscreen/fullscreen.c b/hw/darwin/quartz/fullscreen/fullscreen.c
index 02f6e89a8..ee16e55e5 100644
--- a/hw/darwin/quartz/fullscreen/fullscreen.c
+++ b/hw/darwin/quartz/fullscreen/fullscreen.c
@@ -49,18 +49,17 @@ typedef struct {
} FSScreenRec, *FSScreenPtr;
#define FULLSCREEN_PRIV(pScreen) \
- ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr)
+ ((FSScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, fsScreenKey))
-static int fsScreenIndex;
+static DevPrivateKey fsScreenKey = &fsScreenKey;
static CGDirectDisplayID *quartzDisplayList = NULL;
static int quartzNumScreens = 0;
static FSScreenPtr quartzScreens[MAXSCREENS];
-static int darwinCmapPrivateIndex = -1;
-static unsigned long darwinCmapGeneration = 0;
+static DevPrivateKey darwinCmapPrivateKey = &darwinCmapPrivateKey;
-#define CMAP_PRIV(pCmap) \
- ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr)
+#define CMAP_PRIV(pCmap) ((CGDirectPaletteRef) \
+ dixLookupPrivate(&(pCmap)->devPrivates, darwinCmapPrivateKey))
/*
=============================================================================
@@ -95,16 +94,6 @@ FSCreateColormap(
{
CGDirectPaletteRef pallete;
- // Allocate private storage for the hardware dependent colormap info.
- if (darwinCmapGeneration != serverGeneration) {
- if ((darwinCmapPrivateIndex =
- AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0)
- {
- return FALSE;
- }
- darwinCmapGeneration = serverGeneration;
- }
-
pallete = CGPaletteCreateDefaultColorPalette();
if (!pallete) return FALSE;
@@ -283,17 +272,10 @@ static void FSResumeScreen(
*/
static void FSDisplayInit(void)
{
- static unsigned long generation = 0;
CGDisplayCount quartzDisplayCount = 0;
ErrorF("Display mode: Full screen Quartz -- Direct Display\n");
- // Allocate private storage for each screen's mode specific info
- if (generation != serverGeneration) {
- fsScreenIndex = AllocateScreenPrivateIndex();
- generation = serverGeneration;
- }
-
// Find all the CoreGraphics displays
CGGetActiveDisplayList(0, NULL, &quartzDisplayCount);
quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID));