[PATCH] randr: reply with the server or client version, whichever is lower.

Peter Hutterer peter.hutterer at who-t.net
Wed Sep 16 22:04:54 PDT 2009


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 randr/rrdispatch.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index bec5b08..591d779 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -48,12 +48,18 @@ ProcRRQueryVersion (ClientPtr client)
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
-    /*
-     * Report the current version; the current
-     * spec says they're all compatible after 1.0
-     */
-    rep.majorVersion = SERVER_RANDR_MAJOR;
-    rep.minorVersion = SERVER_RANDR_MINOR;
+
+    if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
+        (SERVER_RANDR_MAJOR * 1000 + SERVER_RANDR_MINOR))
+    {
+	rep.majorVersion = stuff->majorVersion;
+	rep.minorVersion = stuff->minorVersion;
+    } else
+    {
+        rep.majorVersion = SERVER_RANDR_MAJOR;
+        rep.minorVersion = SERVER_RANDR_MINOR;
+    }
+
     if (client->swapped) {
     	swaps(&rep.sequenceNumber, n);
     	swapl(&rep.length, n);
-- 
1.6.3.rc1.2.g0164.dirty


More information about the xorg-devel mailing list