summaryrefslogtreecommitdiff
path: root/Xext/geext.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/geext.c')
-rw-r--r--Xext/geext.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/Xext/geext.c b/Xext/geext.c
index 0c5fcabac..8f48e4493 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -38,7 +38,7 @@ from the author.
int GEEventBase;
int GEErrorBase;
-int GEClientPrivateIndex;
+DevPrivateKey GEClientPrivateKey = &GEClientPrivateKey;
int GEEventType; /* The opcode for all GenericEvents will have. */
@@ -96,7 +96,6 @@ static int ProcGEQueryVersion(ClientPtr client)
swaps(&rep.minorVersion, n);
}
-
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
return(client->noClientException);
}
@@ -166,6 +165,12 @@ static void GEClientCallback(CallbackListPtr *list,
ClientPtr pClient = clientinfo->client;
GEClientInfoPtr pGEClient = GEGetClient(pClient);
+ if (pGEClient == NULL)
+ {
+ pGEClient = xcalloc(1, sizeof(GEClientInfoRec));
+ dixSetPrivate(&pClient->devPrivates, GEClientPrivateKey, pGEClient);
+ }
+
pGEClient->major_version = 0;
pGEClient->minor_version = 0;
}
@@ -200,18 +205,11 @@ SGEGenericEvent(xEvent* from, xEvent* to)
}
/* init extension, register at server */
-void
+void
GEExtensionInit(void)
{
ExtensionEntry *extEntry;
- GEClientPrivateIndex = AllocateClientPrivateIndex();
- if (!AllocateClientPrivate(GEClientPrivateIndex,
- sizeof(GenericMaskRec)))
- {
- FatalError("GEExtensionInit: Alloc client private failed.\n");
- }
-
if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
{
FatalError("GEExtensionInit: register client callback failed.\n");
@@ -228,7 +226,7 @@ GEExtensionInit(void)
memset(GEExtensions, 0, sizeof(GEExtensions));
- EventSwapVector[X_GenericEvent] = (EventSwapPtr) SGEGenericEvent;
+ EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
} else {
FatalError("GEInit: AddExtensions failed.\n");
}