summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-09-17 14:48:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-21 08:12:02 +1000
commit00dfe69aab786ea650b41dfefc031f0e0fc72b0c (patch)
tree42fa2dcaadf5e951d40b894e7e9135448cf52b2d /randr
parent8b75d0f9d347d7c3aad1e53809e0a2bed03b92fc (diff)
randr: reply with the server or client version, whichever is lower.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'randr')
-rw-r--r--randr/rrdispatch.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index bec5b08af..591d77911 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);