summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-09-07 12:22:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-07 12:24:27 +1000
commit369600cf37cd884793c4802a56c8355bc1812dc6 (patch)
treed933b6b63b2d03bc1faf9cf1b2a7f47cb11e2bce /src
parentfa09375a69a02cd789c70d60970a669700eaeb20 (diff)
mask_len in XIGrabDevice is in 4-byte units (#23708)
X.Org Bug 23708 <http://bugs.freedesktop.org/show_bug.cgi?id=23708> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/XIGrabDevice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c
index 66e359b..985d3f1 100644
--- a/src/XIGrabDevice.c
+++ b/src/XIGrabDevice.c
@@ -55,13 +55,13 @@ XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time,
req->grab_mode = grab_mode;
req->paired_device_mode = paired_device_mode;
req->owner_events = owner_events;
- req->mask_len = mask->mask_len;
+ req->mask_len = (mask->mask_len + 3)/4;
req->cursor = cursor;
/* masks.mask_len is in bytes, but we need 4-byte units on the wire,
* and they need to be padded with 0 */
- len = (mask->mask_len + 3) / 4;
+ len = req->mask_len * 4;
buff = calloc(1, len);
memcpy(buff, mask->mask, mask->mask_len);