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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-09-17 14:48:51 +10:00
parent 8b75d0f9d3
commit 00dfe69aab

View File

@ -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
*/
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);