GetPointerEvents: always ensure correct number of events
Ensure correct number of valuator events are returned, and that we always increment events correctly.
This commit is contained in:
parent
65cd5aa4d7
commit
aabc087998
|
@ -504,7 +504,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
num_events = 1;
|
num_events = 1;
|
||||||
|
|
||||||
/* Do we need to send a DeviceValuator event? */
|
/* Do we need to send a DeviceValuator event? */
|
||||||
if ((num_valuators + first_valuator) >= 2 && sendValuators) {
|
if ((num_valuators + first_valuator) > 2 && sendValuators) {
|
||||||
if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS)
|
if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS)
|
||||||
num_valuators = MAX_VALUATOR_EVENTS * 6;
|
num_valuators = MAX_VALUATOR_EVENTS * 6;
|
||||||
num_events += ((num_valuators - 1) / 6) + 1;
|
num_events += ((num_valuators - 1) / 6) + 1;
|
||||||
|
@ -614,9 +614,9 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
kbp->root_x = x;
|
kbp->root_x = x;
|
||||||
kbp->root_y = y;
|
kbp->root_y = y;
|
||||||
|
|
||||||
|
events++;
|
||||||
if (final_valuator > 2 && sendValuators) {
|
if (final_valuator > 2 && sendValuators) {
|
||||||
kbp->deviceid |= MORE_EVENTS;
|
kbp->deviceid |= MORE_EVENTS;
|
||||||
events++;
|
|
||||||
clipValuators(pDev, first_valuator, num_valuators, valuators);
|
clipValuators(pDev, first_valuator, num_valuators, valuators);
|
||||||
events = getValuatorEvents(events, pDev, first_valuator,
|
events = getValuatorEvents(events, pDev, first_valuator,
|
||||||
num_valuators, valuators);
|
num_valuators, valuators);
|
||||||
|
|
Loading…
Reference in New Issue