GetPointerEvents: always send valuator events for MotionNotify
Always chase a DeviceMotionNotify event with a DeviceValuator, which is not required in the spec, but will silently break the lib if you don't include.
This commit is contained in:
parent
c458a70d65
commit
72e7f2ac6c
|
@ -484,6 +484,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
int num_events = 0, final_valuator = 0;
|
int num_events = 0, final_valuator = 0;
|
||||||
CARD32 ms = 0;
|
CARD32 ms = 0;
|
||||||
deviceKeyButtonPointer *kbp = NULL;
|
deviceKeyButtonPointer *kbp = NULL;
|
||||||
|
/* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies
|
||||||
|
* with DeviceValuators. */
|
||||||
Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE);
|
Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE);
|
||||||
DeviceIntPtr cp = inputInfo.pointer;
|
DeviceIntPtr cp = inputInfo.pointer;
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
@ -500,15 +502,16 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
else
|
else
|
||||||
num_events = 1;
|
num_events = 1;
|
||||||
|
|
||||||
|
if (type == MotionNotify && num_valuators <= 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Do we need to send a DeviceValuator event? */
|
/* Do we need to send a DeviceValuator event? */
|
||||||
if ((num_valuators + first_valuator) > 2 && sendValuators) {
|
if (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;
|
||||||
}
|
}
|
||||||
else if (type == MotionNotify && num_valuators <= 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
final_valuator = num_valuators + first_valuator;
|
final_valuator = num_valuators + first_valuator;
|
||||||
|
|
||||||
|
@ -614,7 +617,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
kbp->root_y = y;
|
kbp->root_y = y;
|
||||||
|
|
||||||
events++;
|
events++;
|
||||||
if (final_valuator > 2 && sendValuators) {
|
if (sendValuators) {
|
||||||
kbp->deviceid |= MORE_EVENTS;
|
kbp->deviceid |= MORE_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,
|
||||||
|
|
Loading…
Reference in New Issue