diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-12-05 10:12:57 +1000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-12-09 20:43:48 -0800 |
commit | db5abde7ea0e482041d16d7d5f3715cd4f6222d3 (patch) | |
tree | beeb29524fecadf440c100a5e1b332ed7fbd4d5a /dix | |
parent | d679cf70a79aa53e823f4fa51a7ab19837f26525 (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>
(cherry picked from commit ee1a6c28418a6dad6c89f79a994f27bfbaa77368)
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/getevents.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 82be5e9bc..9592d4cc5 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -728,9 +728,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; } |