mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 20:40:04 +01:00
Xi: reply with the XI2 version that is supported by both client and server.
XIQueryVersion must return the client's version if the client's version is lower than or equal to the server's version, or the server's version otherwise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
d979f44394
commit
6ea76c5504
1 changed files with 9 additions and 4 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#include "exglobals.h"
|
||||
#include "exevents.h"
|
||||
#include "queryversion.h"
|
||||
#include "misc.h"
|
||||
|
||||
extern XExtensionVersion XIVersion; /* defined in getvers.c */
|
||||
/**
|
||||
|
|
@ -56,22 +57,26 @@ ProcXIQueryVersion(ClientPtr client)
|
|||
{
|
||||
xXIQueryVersionReply rep;
|
||||
XIClientPtr pXIClient;
|
||||
int major, minor;
|
||||
|
||||
REQUEST(xXIQueryVersionReq);
|
||||
REQUEST_SIZE_MATCH(xXIQueryVersionReq);
|
||||
|
||||
pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
|
||||
|
||||
pXIClient->major_version = stuff->major_version;
|
||||
pXIClient->minor_version = stuff->minor_version;
|
||||
major = min(XIVersion.major_version, stuff->major_version);
|
||||
minor = min(XIVersion.minor_version, stuff->minor_version);
|
||||
|
||||
pXIClient->major_version = major;
|
||||
pXIClient->minor_version = minor;
|
||||
|
||||
memset(&rep, 0, sizeof(xXIQueryVersionReply));
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_XIQueryVersion;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.major_version = XIVersion.major_version;
|
||||
rep.minor_version = XIVersion.minor_version;
|
||||
rep.major_version = major;
|
||||
rep.minor_version = minor;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue