From 109ec12489f050e537d26eed2e60c6d97eb7439f Mon Sep 17 00:00:00 2001 From: Tobias Koch Date: Wed, 29 Sep 2010 18:03:30 +0300 Subject: Allow more than 6 axes to be sent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Tobias Koch 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 Reviewed-by: Rami Ylimäki Signed-off-by: Peter Hutterer --- src/XTest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.1