aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiqueryversion.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
committermarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
commit0f834b91a4768673833ab4917e87d86c237bb1a6 (patch)
tree363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/Xi/xiqueryversion.c
parentfc72edebf875378459368c5383d9023730cbca54 (diff)
downloadvcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/Xi/xiqueryversion.c')
-rw-r--r--xorg-server/Xi/xiqueryversion.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/xorg-server/Xi/xiqueryversion.c b/xorg-server/Xi/xiqueryversion.c
index a94061432..fc0ca751b 100644
--- a/xorg-server/Xi/xiqueryversion.c
+++ b/xorg-server/Xi/xiqueryversion.c
@@ -33,7 +33,6 @@
#include <dix-config.h>
#endif
-
#include "inputstr.h"
#include <X11/Xmd.h>
@@ -45,7 +44,8 @@
#include "xiqueryversion.h"
#include "misc.h"
-extern XExtensionVersion XIVersion; /* defined in getvers.c */
+extern XExtensionVersion XIVersion; /* defined in getvers.c */
+
/**
* Return the supported XI version.
*
@@ -63,21 +63,28 @@ ProcXIQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xXIQueryVersionReq);
/* This request only exists after XI2 */
- if (stuff->major_version < 2)
- {
+ if (stuff->major_version < 2) {
client->errorValue = stuff->major_version;
return BadValue;
}
pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
- if (version_compare(XIVersion.major_version, XIVersion.minor_version,
- stuff->major_version, stuff->minor_version) > 0)
+ if (pXIClient->major_version &&
+ (stuff->major_version != pXIClient->major_version ||
+ stuff->minor_version != pXIClient->minor_version))
{
+ client->errorValue = stuff->major_version;
+ return BadValue;
+ }
+
+
+ if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+ stuff->major_version, stuff->minor_version) > 0) {
major = stuff->major_version;
minor = stuff->minor_version;
- } else
- {
+ }
+ else {
major = XIVersion.major_version;
minor = XIVersion.minor_version;
}
@@ -112,11 +119,11 @@ SProcXIQueryVersion(ClientPtr client)
}
void
-SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep)
+SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->major_version);
swaps(&rep->minor_version);
- WriteToClient(client, size, (char *)rep);
+ WriteToClient(client, size, (char *) rep);
}