summaryrefslogtreecommitdiff
path: root/cfb/cfballpriv.c
diff options
context:
space:
mode:
Diffstat (limited to 'cfb/cfballpriv.c')
-rw-r--r--cfb/cfballpriv.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c
index e0ccdf4d0..e6ab93a87 100644
--- a/cfb/cfballpriv.c
+++ b/cfb/cfballpriv.c
@@ -45,48 +45,37 @@ in this Software without prior written authorization from The Open Group.
#include "mibstore.h"
#if 1 || PSZ==8
-int cfbWindowPrivateIndex = -1;
-int cfbGCPrivateIndex = -1;
+DevPrivateKey cfbWindowPrivateKey = &cfbWindowPrivateKey;
+DevPrivateKey cfbGCPrivateKey = &cfbGCPrivateKey;
#endif
#ifdef CFB_NEED_SCREEN_PRIVATE
-int cfbScreenPrivateIndex = -1;
-static unsigned long cfbGeneration = 0;
+DevPrivateKey cfbScreenPrivateKey = &cfbScreenPrivateKey;
#endif
Bool
-cfbAllocatePrivates(pScreen, window_index, gc_index)
+cfbAllocatePrivates(pScreen, window_key, gc_key)
ScreenPtr pScreen;
- int *window_index, *gc_index;
+ DevPrivateKey *window_key, *gc_key;
{
- if (!window_index || !gc_index ||
- (*window_index == -1 && *gc_index == -1))
+ if (!window_key || !gc_key || (!*window_key && !*gc_key))
{
if (!mfbAllocatePrivates(pScreen,
- &cfbWindowPrivateIndex, &cfbGCPrivateIndex))
+ &cfbWindowPrivateKey, &cfbGCPrivateKey))
return FALSE;
- if (window_index)
- *window_index = cfbWindowPrivateIndex;
- if (gc_index)
- *gc_index = cfbGCPrivateIndex;
+ if (window_key)
+ *window_key = cfbWindowPrivateKey;
+ if (gc_key)
+ *gc_key = cfbGCPrivateKey;
}
else
{
- cfbWindowPrivateIndex = *window_index;
- cfbGCPrivateIndex = *gc_index;
+ cfbWindowPrivateKey = *window_key;
+ cfbGCPrivateKey = *gc_key;
}
- if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex,
- sizeof(cfbPrivWin)) ||
- !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
+ if (!dixRequestPrivate(cfbWindowPrivateKey, sizeof(cfbPrivWin)))
return FALSE;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- if (cfbGeneration != serverGeneration)
- {
- cfbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- cfbGeneration = serverGeneration;
- }
- if (cfbScreenPrivateIndex == -1)
+ if (!dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC)))
return FALSE;
-#endif
return TRUE;
}