summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-12-05 00:12:57 (GMT)
committerPeter Hutterer <peter.hutterer@who-t.net>2008-12-08 02:05:52 (GMT)
commitee1a6c28418a6dad6c89f79a994f27bfbaa77368 (patch)
tree638ec6f2df1015b6ac8d71a432d094047652233d
parent13de7511b17b57a28668e1a60b196ccfe61dbcbe (diff)
dix: fix calculation of valuator events.
Follow-up to 4971315296cb. countValuatorEvents was copied from GKVE where it was obviously broken but nobody noticed. GPE had the correct version, but that one got lost during de-duplication. Restoring the correct calculation - if we have 6 valuators, we want 1 valuator event, not 2. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
-rw-r--r--dix/getevents.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index b77ea46..19e6fa7 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -772,9 +772,9 @@ static int
countValuatorEvents(int num_valuators)
{
if (num_valuators) {
- if ((num_valuators / 6) + 1 > MAX_VALUATOR_EVENTS)
- num_valuators = MAX_VALUATOR_EVENTS;
- return (num_valuators / 6) + 1;
+ if (((num_valuators - 1) / 6) + 1 > MAX_VALUATOR_EVENTS)
+ num_valuators = MAX_VALUATOR_EVENTS * 6;
+ return ((num_valuators - 1)/ 6) + 1;
} else
return 0;
}