diff --git a/dix/getevents.c b/dix/getevents.c index 9c4ed0ece..0150d6658 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -484,6 +484,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, int num_events = 0, final_valuator = 0; CARD32 ms = 0; deviceKeyButtonPointer *kbp = NULL; + /* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies + * with DeviceValuators. */ Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE); DeviceIntPtr cp = inputInfo.pointer; int x = 0, y = 0; @@ -500,15 +502,16 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, else num_events = 1; + if (type == MotionNotify && num_valuators <= 0) { + return 0; + } + /* 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) num_valuators = MAX_VALUATOR_EVENTS * 6; num_events += ((num_valuators - 1) / 6) + 1; } - else if (type == MotionNotify && num_valuators <= 0) { - return 0; - } final_valuator = num_valuators + first_valuator; @@ -614,7 +617,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, kbp->root_y = y; events++; - if (final_valuator > 2 && sendValuators) { + if (sendValuators) { kbp->deviceid |= MORE_EVENTS; clipValuators(pDev, first_valuator, num_valuators, valuators); events = getValuatorEvents(events, pDev, first_valuator,