diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
commit | 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch) | |
tree | 092efcfc39e3e293baaf04c4c84027ee453d3e13 /Xext/geext.c | |
parent | eace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff) | |
parent | ae869fc7669764729e13fdd70149ed636753f2a3 (diff) |
Merge branch 'master' into mpx
Conflicts:
XTrap/xtrapddmi.c
Xext/security.c
Xext/xprint.c
Xext/xtest.c
Xext/xvdisp.c
Xi/exevents.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/opendev.c
Xi/ungrdev.c
Xi/ungrdevb.c
Xi/ungrdevk.c
dix/cursor.c
dix/devices.c
dix/dixutils.c
dix/events.c
dix/getevents.c
dix/main.c
dix/window.c
hw/xfree86/ramdac/xf86Cursor.c
include/dix.h
include/input.h
include/inputstr.h
mi/midispcur.c
mi/miinitext.c
mi/misprite.c
render/animcur.c
xfixes/cursor.c
xkb/xkbAccessX.c
Diffstat (limited to 'Xext/geext.c')
-rw-r--r-- | Xext/geext.c | 20 |
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"); } |