Skip to content

Commit

Permalink
render: reply with the server or client version, whichever is lower.
Browse files Browse the repository at this point in the history
Protocol requires that the lower of [server version, client version] is
returned to the client.

The other part of the issue discussed in reply to [1] remains.
[1] http://lists.freedesktop.org/archives/xorg-devel/2009-September/001990.html

Reported-by: Julien Cristau

Signed-off-by: Peter Hutterer <[email protected]>
  • Loading branch information
whot committed Sep 20, 2009
1 parent 20ccc66 commit 8b75d0f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions render/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,18 @@ ProcRenderQueryVersion (ClientPtr client)
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = RENDER_MAJOR;
rep.minorVersion = RENDER_MINOR;

if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
(RENDER_MAJOR * 1000 + RENDER_MINOR))
{
rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion;
} else
{
rep.majorVersion = RENDER_MAJOR;
rep.minorVersion = RENDER_MINOR;
}

if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
Expand Down

0 comments on commit 8b75d0f

Please sign in to comment.