diff options
author | Tobias Koch <tobias.koch@nokia.com> | 2010-09-29 18:03:30 +0300 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-13 07:51:33 +1000 |
commit | 109ec12489f050e537d26eed2e60c6d97eb7439f (patch) | |
tree | b8b54fa6c4d6e63e810772300ef0ef493478cd75 /src | |
parent | 809ceed85bb577d4bbf80f2d84382375c65b9fbe (diff) |
Allow more than 6 axes to be sent.
From: Tobias Koch <tobias.koch@nokia.com>
If the number of axes exceeds 6, X server will return BadValue for
XTestFakeInput because the number of axes in a single DeviceValuator
event is incorrectly set to the total number of axes.
Signed-off-by: Tobias Koch <tobias.koch@nokia.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/XTest.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/XTest.c b/src/XTest.c index 6a44e60..76193a1 100644 --- a/src/XTest.c +++ b/src/XTest.c @@ -265,12 +265,10 @@ send_axes( req->length += ((n_axes + 5) / 6) * (SIZEOF(xEvent) >> 2); ev.type = XI_DeviceValuator + (long)info->data; ev.deviceid = dev->device_id; - ev.num_valuators = n_axes; ev.first_valuator = first_axis; while (n_axes > 0) { - n = n_axes; - if (n > 6) - n = 6; + n = n_axes > 6 ? 6 : n_axes; + ev.num_valuators = n; switch (n) { case 6: ev.valuator5 = *(axes+5); |