mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 16:10:30 +01:00
dix: fix calculation of valuator events.
Follow-up to4971315296. 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 commitee1a6c2841) Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d679cf70a7
commit
db5abde7ea
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue