Xi: reset the known properties at the end of the server generation.

Properties allocated through XIGetKnownProperty() aren't reset on the second
server generation but keep the old value. As a result, wrong Atoms are
supplied to the driver, resulting in potential data corruption or weird
error message.

Reproducible by running "xlsatom | grep FLOAT" twice on a plain X server.
The second X server generation won't have the FLOAT atom defined anymore,
despite the users of this atom not noticing any errors.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9802839d35)
This commit is contained in:
Peter Hutterer 2010-05-07 16:22:12 +10:00 committed by Julien Cristau
parent 240e7c50ce
commit 266dc682f6
3 changed files with 13 additions and 0 deletions

View File

@ -1123,6 +1123,7 @@ RestoreExtensionEvents(void)
static void
IResetProc(ExtensionEntry * unused)
{
XIResetProperties();
ReplySwapVector[IReqCode] = ReplyNotSwappd;
EventSwapVector[DeviceValuator] = NotImplemented;

View File

@ -392,6 +392,15 @@ XIGetKnownProperty(char *name)
return 0;
}
void
XIResetProperties(void)
{
int i;
for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
dev_properties[i].type = None;
}
/**
* Convert the given property's value(s) into @nelem_return integer values and
* store them in @buf_return. If @nelem_return is larger than the number of

View File

@ -62,4 +62,7 @@ void SRepXIListProperties(ClientPtr client, int size,
xXIListPropertiesReply *rep);
void SRepXIGetProperty(ClientPtr client, int size,
xXIGetPropertyReply *rep);
void XIResetProperties(void);
#endif /* XIPROPERTY_H */