Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
grab_window and touchid were removed from the struct for ABI compatibility reasons, we need to pull in the new, XI 2.2-specific struct. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
b96275c4cd
commit
7674d00b04
|
@ -41,6 +41,7 @@
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
|
|
||||||
#include "exglobals.h" /* BadDevice */
|
#include "exglobals.h" /* BadDevice */
|
||||||
|
#include "exevents.h"
|
||||||
#include "xiallowev.h"
|
#include "xiallowev.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -51,8 +52,12 @@ SProcXIAllowEvents(ClientPtr client)
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
swaps(&stuff->deviceid);
|
swaps(&stuff->deviceid);
|
||||||
swapl(&stuff->time);
|
swapl(&stuff->time);
|
||||||
/* FIXME swap touchid */
|
if (stuff->length > 3)
|
||||||
/* FIXME swap window */
|
{
|
||||||
|
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq*)stuff;
|
||||||
|
swapl(&req_xi22->touchid);
|
||||||
|
swapl(&req_xi22->grab_window);
|
||||||
|
}
|
||||||
|
|
||||||
return ProcXIAllowEvents(client);
|
return ProcXIAllowEvents(client);
|
||||||
}
|
}
|
||||||
|
@ -63,9 +68,21 @@ ProcXIAllowEvents(ClientPtr client)
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int ret = Success;
|
int ret = Success;
|
||||||
|
XIClientPtr xi_client;
|
||||||
|
Bool have_xi22 = FALSE;
|
||||||
|
REQUEST(xXI2_2AllowEventsReq);
|
||||||
|
|
||||||
REQUEST(xXIAllowEventsReq);
|
xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
|
||||||
/* FIXME: check request length, 12 for XI 2.0+, 20 for XI 2.2+ */
|
|
||||||
|
if (version_compare(xi_client->major_version,
|
||||||
|
xi_client->minor_version, 2, 2) >= 0)
|
||||||
|
{
|
||||||
|
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
|
||||||
|
have_xi22 = TRUE;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
REQUEST_SIZE_MATCH(xXIAllowEventsReq);
|
||||||
|
}
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
@ -97,8 +114,20 @@ ProcXIAllowEvents(ClientPtr client)
|
||||||
break;
|
break;
|
||||||
case XIRejectTouch:
|
case XIRejectTouch:
|
||||||
case XIAcceptTouch:
|
case XIAcceptTouch:
|
||||||
ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
|
{
|
||||||
stuff->grab_window, &client->errorValue);
|
int rc;
|
||||||
|
WindowPtr win;
|
||||||
|
|
||||||
|
if (!have_xi22)
|
||||||
|
return BadValue;
|
||||||
|
|
||||||
|
rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
|
||||||
|
stuff->grab_window, &client->errorValue);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
client->errorValue = stuff->mode;
|
client->errorValue = stuff->mode;
|
||||||
|
|
|
@ -776,7 +776,7 @@ XPROTO="xproto >= 7.0.22"
|
||||||
RANDRPROTO="randrproto >= 1.2.99.3"
|
RANDRPROTO="randrproto >= 1.2.99.3"
|
||||||
RENDERPROTO="renderproto >= 0.11"
|
RENDERPROTO="renderproto >= 0.11"
|
||||||
XEXTPROTO="xextproto >= 7.1.99"
|
XEXTPROTO="xextproto >= 7.1.99"
|
||||||
INPUTPROTO="inputproto >= 2.1.99.5"
|
INPUTPROTO="inputproto >= 2.1.99.6"
|
||||||
KBPROTO="kbproto >= 1.0.3"
|
KBPROTO="kbproto >= 1.0.3"
|
||||||
FONTSPROTO="fontsproto"
|
FONTSPROTO="fontsproto"
|
||||||
FIXESPROTO="fixesproto >= 5.0"
|
FIXESPROTO="fixesproto >= 5.0"
|
||||||
|
|
Loading…
Reference in New Issue