Comment 40 for bug 799202

Jussi Pakkanen (jpakkane) wrote :

I looked into Qt and there are three locations where x and y tilt values are obtained. They are all in qapplication_x11.cpp in the function QETWidget::translateXinputEvent.

The first one is this (I have removed quite a lot of lines, check the original to be sure):

s = XQueryDeviceState(X11->display, static_cast<XDevice *>(tablet->device));
for (j = 0; j < s->num_classes; j++) {
  if (!proximity) {
      xTilt = short(vs->valuators[WAC_XTILT_I]);
      yTilt = short(vs->valuators[WAC_YTILT_I]);
      pressure = vs->valuators[WAC_PRESSURE_I];

So it loops over something(?) and grabs things. Then a bit later it does this:

if (motion) {
    xTilt = (short) motion->axis_data[3];
    yTilt = (short) motion->axis_data[4];

where motion is an XDeviceMotionEvent.

Immediately afte that it does

} else if (button) {
    xTilt = (short) button->axis_data[3];
    yTilt = (short) button->axis_data[4];

where button is an XDeviceButtonEvent.

Based on this the potential bugs are that either Qt does masked valuators wrong or the X server gives incorrect data in event structures. The xinput output mentioned above would seem to indicate that the fault lies with Qt.

Chase, what do you think?