Xi: create well-known atoms on demand, rather than preinit them

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Simon Thum 2009-01-23 12:06:16 +01:00 committed by Peter Hutterer
parent 32adf8d34f
commit 6bf6a4c47e
3 changed files with 10 additions and 23 deletions

View File

@ -1143,7 +1143,6 @@ XInputExtensionInit(void)
IEventBase = extEntry->eventBase; IEventBase = extEntry->eventBase;
AllExtensionVersions[IReqCode - 128] = thisversion; AllExtensionVersions[IReqCode - 128] = thisversion;
MakeDeviceTypeAtoms(); MakeDeviceTypeAtoms();
XIInitKnownProperties();
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone); RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT"); RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT");
FixExtensionEvents(extEntry); FixExtensionEvents(extEntry);

View File

@ -97,7 +97,7 @@ static struct dev_properties
static long XIPropHandlerID = 1; static long XIPropHandlerID = 1;
/** /**
* Return the type assigned to the specified atom or 0 if the atom isn't known * Return the atom assigned to the specified string or 0 if the atom isn't known
* to the DIX. * to the DIX.
*/ */
Atom Atom
@ -106,8 +106,16 @@ XIGetKnownProperty(char *name)
int i; int i;
for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
{ {
if (strcmp(name, dev_properties[i].name) == 0) if (strcmp(name, dev_properties[i].name) == 0){
if (dev_properties[i].type == None){
dev_properties[i].type =
MakeAtom(dev_properties[i].name,
strlen(dev_properties[i].name),
TRUE);
}
return dev_properties[i].type; return dev_properties[i].type;
}
} }
return 0; return 0;
@ -232,24 +240,6 @@ XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return)
return Success; return Success;
} }
/**
* Init those properties that are allocated by the server and most likely used
* by the DIX or the DDX.
*/
void
XIInitKnownProperties(void)
{
int i;
for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
{
dev_properties[i].type =
MakeAtom(dev_properties[i].name,
strlen(dev_properties[i].name),
TRUE);
}
}
/* Registers a new property handler on the given device and returns a unique /* Registers a new property handler on the given device and returns a unique
* identifier for this handler. This identifier is required to unregister the * identifier for this handler. This identifier is required to unregister the
* property handler again. * property handler again.

View File

@ -43,6 +43,4 @@ void SRepXListDeviceProperties(ClientPtr client, int size,
void SRepXGetDeviceProperty(ClientPtr client, int size, void SRepXGetDeviceProperty(ClientPtr client, int size,
xGetDevicePropertyReply *rep); xGetDevicePropertyReply *rep);
void XIInitKnownProperties(void);
#endif /* XIPROPERTY_C */ #endif /* XIPROPERTY_C */