From 55747d256d759850141e4a9c4dec965616a31dc8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 18 Sep 2009 16:27:54 +1000 Subject: input: define server-supported protocol versions in one single file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit include/protocol-versions.h specifies each extension version as supported by the server and sent back on the wire to the client. This fixes up several issues with the server potentially reporting a higher version of the protocol if recompiled against a newer version of the protocol. Signed-off-by: Peter Hutterer Acked-by: RĂ©mi Cardona Acked-by: Julien Cristau --- damageext/damageext.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'damageext') diff --git a/damageext/damageext.c b/damageext/damageext.c index 8fa1c5314..449c2fd0e 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -25,6 +25,7 @@ #endif #include "damageextint.h" +#include "protocol-versions.h" static unsigned char DamageReqCode; static int DamageEventBase; @@ -35,13 +36,6 @@ static RESTYPE DamageExtWinType; static int DamageClientPrivateKeyIndex; static DevPrivateKey DamageClientPrivateKey = &DamageClientPrivateKeyIndex; -/* 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] static void @@ -148,16 +142,16 @@ ProcDamageQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < SERVER_DAMAGE_MAJOR) { + if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { - rep.majorVersion = SERVER_DAMAGE_MAJOR; - if (stuff->majorVersion == SERVER_DAMAGE_MAJOR && - stuff->minorVersion < SERVER_DAMAGE_MINOR) + rep.majorVersion = SERVER_DAMAGE_MAJOR_VERSION; + if (stuff->majorVersion == SERVER_DAMAGE_MAJOR_VERSION && + stuff->minorVersion < SERVER_DAMAGE_MINOR_VERSION) rep.minorVersion = stuff->minorVersion; else - rep.minorVersion = SERVER_DAMAGE_MINOR; + rep.minorVersion = SERVER_DAMAGE_MINOR_VERSION; } pDamageClient->major_version = rep.majorVersion; pDamageClient->minor_version = rep.minorVersion; -- cgit v1.2.3