fix incorrect button test

Test for n (1..nButtons) being under nButtons, not button (1..(1<<nButtons)).
This commit is contained in:
Daniel Stone 2006-08-04 11:18:16 +03:00 committed by Daniel Stone
parent 87fe85f38b
commit 997ba45b19

View File

@ -2087,7 +2087,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
buttons = flags;
for (button = KD_BUTTON_1, n = 1; button <= pi->nButtons;
for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons;
button <<= 1, n++) {
if (((pi->buttonState & button) ^ (buttons & button)) &&
!(buttons & button)) {
@ -2098,7 +2098,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
dixflags, FALSE);
}
}
for (button = KD_BUTTON_1, n = 1; button <= pi->nButtons;
for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons;
button <<= 1, n++) {
if (((pi->buttonState & button) ^ (buttons & button)) &&
(buttons & button)) {