[PATCH] render: return the supported version rather than just passing the proto's version

Julien Cristau jcristau at debian.org
Sun Sep 13 03:00:12 PDT 2009


---
 render/render.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

The spec says "the server sends the highest version it supports, but no
higher than the requested version".

This patch makes us send the highest version we support, rather than
whatever renderproto version was used when building the server.  Should
we start checking the client's version as well?  (the randr spec has the
same language, and the code just returns SERVER_RANDR_M{AJ,IN}OR)

diff --git a/render/render.c b/render/render.c
index 995ebd9..03bc94a 100644
--- a/render/render.c
+++ b/render/render.c
@@ -52,6 +52,9 @@
 #define UINT32_MAX 0xffffffffU
 #endif
 
+#define SERVER_RENDER_MAJOR 0
+#define SERVER_RENDER_MINOR 11
+
 static int ProcRenderQueryVersion (ClientPtr pClient);
 static int ProcRenderQueryPictFormats (ClientPtr pClient);
 static int ProcRenderQueryPictIndexValues (ClientPtr pClient);
@@ -270,8 +273,8 @@ ProcRenderQueryVersion (ClientPtr client)
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
-    rep.majorVersion = RENDER_MAJOR;
-    rep.minorVersion = RENDER_MINOR;
+    rep.majorVersion = SERVER_RENDER_MAJOR;
+    rep.minorVersion = SERVER_RENDER_MINOR;
     if (client->swapped) {
     	swaps(&rep.sequenceNumber, n);
     	swapl(&rep.length, n);
-- 
1.6.3.3



More information about the xorg-devel mailing list