Set the Damage version supported in the server, instead of using damageproto.

This was caught by distributions upgrading damageproto to 1.1, before the
server they had supported it.  The server then advertised the new version
without supporting the protocol.
This commit is contained in:
Eric Anholt 2007-02-01 12:15:54 -08:00
parent 8bce182568
commit 8274ea6aa9

View File

@ -35,6 +35,13 @@ int DamageClientPrivateIndex;
RESTYPE DamageExtType; RESTYPE DamageExtType;
RESTYPE DamageExtWinType; RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header
* supports.
*/
#define SERVER_DAMAGE_MAJOR 1
#define SERVER_DAMAGE_MINOR 1
#define prScreen screenInfo.screens[0] #define prScreen screenInfo.screens[0]
static void static void
@ -143,16 +150,16 @@ ProcDamageQueryVersion(ClientPtr client)
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
if (stuff->majorVersion < DAMAGE_MAJOR) { if (stuff->majorVersion < SERVER_DAMAGE_MAJOR) {
rep.majorVersion = stuff->majorVersion; rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion; rep.minorVersion = stuff->minorVersion;
} else { } else {
rep.majorVersion = DAMAGE_MAJOR; rep.majorVersion = SERVER_DAMAGE_MAJOR;
if (stuff->majorVersion == DAMAGE_MAJOR && if (stuff->majorVersion == SERVER_DAMAGE_MAJOR &&
stuff->minorVersion < DAMAGE_MINOR) stuff->minorVersion < SERVER_DAMAGE_MINOR)
rep.minorVersion = stuff->minorVersion; rep.minorVersion = stuff->minorVersion;
else else
rep.minorVersion = DAMAGE_MINOR; rep.minorVersion = SERVER_DAMAGE_MINOR;
} }
pDamageClient->major_version = rep.majorVersion; pDamageClient->major_version = rep.majorVersion;
pDamageClient->minor_version = rep.minorVersion; pDamageClient->minor_version = rep.minorVersion;