summaryrefslogtreecommitdiff
path: root/xfixes
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-11-03 20:23:43 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2012-11-06 10:48:32 +1000
commit04c885de715a7c989e48fc8cf2e61db2b401de2d (patch)
tree9d73f638e2cc9a783caeff235260a0ae2e2aab8e /xfixes
parentd74b63f95fc622afe83c53580f1b55346d55fa7a (diff)
cursor: CreatePointerBarrier has a variable request length
Support this, and swap the devices in the SProc as well. Don't actually do anything with the devices just yet -- specifying any should still emit a BadImplementation. Based on a patch by Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xfixes')
-rw-r--r--xfixes/cursor.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index c45da27a9..75b03749d 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -1279,7 +1279,7 @@ ProcXFixesCreatePointerBarrier(ClientPtr client)
REQUEST(xXFixesCreatePointerBarrierReq);
- REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
LEGAL_NEW_RESOURCE(stuff->barrier, client);
err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
@@ -1318,9 +1318,13 @@ int
SProcXFixesCreatePointerBarrier(ClientPtr client)
{
REQUEST(xXFixesCreatePointerBarrierReq);
+ int i;
+ CARD16 *in_devices = (CARD16 *) &stuff[1];
swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
+ swaps(&stuff->num_devices);
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
+
swapl(&stuff->barrier);
swapl(&stuff->window);
swaps(&stuff->x1);
@@ -1328,6 +1332,10 @@ SProcXFixesCreatePointerBarrier(ClientPtr client)
swaps(&stuff->x2);
swaps(&stuff->y2);
swapl(&stuff->directions);
+ for (i = 0; i < stuff->num_devices; i++) {
+ swaps(in_devices + i);
+ }
+
return ProcXFixesVector[stuff->xfixesReqType] (client);
}