Skip to content

Commit

Permalink
randr: reply with the server or client version, whichever is lower.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hutterer <[email protected]>
  • Loading branch information
whot committed Sep 20, 2009
1 parent 8b75d0f commit 00dfe69
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions randr/rrdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 00dfe69

Please sign in to comment.