From 745b90cde1007383ec8c887f02439a34ab427f31 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Apr 2008 11:27:22 +0930 Subject: [PATCH] Xext: re-do the XGE versioning handling. Basically the same approach RandR takes. Remember which one the client requested, send back the one the server supports. Also divide XGE server version (now defined in geext.c) and the client's version (still in the protocol definition). --- Xext/geext.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Xext/geext.c b/Xext/geext.c index 83473226f..c6c871390 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -1,4 +1,4 @@ -/* +/* Copyright 2007 Peter Hutterer @@ -36,6 +36,11 @@ from the author. #include "geint.h" #include "geext.h" +/* Currently supported XGE version */ +#define SERVER_GE_MAJOR 1 +#define SERVER_GE_MINOR 0 + + int GEEventBase; int GEErrorBase; DevPrivateKey GEClientPrivateKey = &GEClientPrivateKey; @@ -73,20 +78,13 @@ static int ProcGEQueryVersion(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < GE_MAJOR) { - rep.majorVersion = stuff->majorVersion; - rep.minorVersion = stuff->minorVersion; - } else { - rep.majorVersion = GE_MAJOR; - if (stuff->majorVersion == GE_MAJOR && - stuff->minorVersion < GE_MINOR) - rep.minorVersion = stuff->minorVersion; - else - rep.minorVersion = GE_MINOR; - } + /* return the supported version by the server */ + rep.majorVersion = SERVER_GE_MAJOR; + rep.minorVersion = SERVER_GE_MINOR; - pGEClient->major_version = rep.majorVersion; - pGEClient->minor_version = rep.minorVersion; + /* Remember version the client requested */ + pGEClient->major_version = stuff->majorVersion; + pGEClient->minor_version = stuff->minorVersion; if (client->swapped) { @@ -156,7 +154,12 @@ SProcGEDispatch(ClientPtr client) return (*SProcGEVector[stuff->ReqType])(client); } -/* new client callback */ +/** + * Called when a new client inits a connection to the X server. + * + * We alloc a simple struct to store the client's major/minor version. Can be + * used in the furture for versioning support. + */ static void GEClientCallback(CallbackListPtr *list, pointer closure, pointer data)