Comment 57 for bug 726832

Revision history for this message
In , Mikiausch (mikiausch) wrote :

I don't know If this is caused by the same issue, but the problem is quite siilar, so I attach this as a commen instead of filing a new bug. I'm using debian testing / x.org 1.17.2 with a Lenovo U41 which has an ALPS touchpad.

The problem is that the touchpad is way faster on the horizontal axis than on the vertical axis: while a swipe from left to right will move the pointer approximately from the left to the right screen edge, a complete top-down swipe only covers one quarter of the screen - of course influenced by the acceleration settings.

Fiddling with the "VertResolution" and "HorizResolution" options didn't show any effect for me.

Looking at the code it seems that these options were actually rendered useless when the synaptics driver scaling was removed in commit #0fb59b3487d57523a03f078a2061e2ea0cacbc7c. The driver always passes the resolution values reported by the device to the server instead of the overwritten ones from the config.

Some debugging later, this is what the device reports to the server:
minx: 0, maxx: 4095, resx: 40
miny: 0, maxy: 2047, resy: 71

So it looks like the device has indeed a different resolution in x and y and this seems to get mix up the scaling somehow.

I tried to make the driver pass the VertResolution and HorizResolution parameters instead of the device values by changing some lines from synaptics.c:

xf86InitValuatorAxisStruct(dev, 0, axes_labels[0], min, max, priv->resx * 1000, 0, priv->resx * 1000, Relative);

into

xf86InitValuatorAxisStruct(dev, 0, axes_labels[0], min, max, priv->synpara.resolution_horiz * 1000, 0, priv->synpara.resolution_horiz * 1000, Relative);

and

xf86InitValuatorAxisStruct(dev, 1, axes_labels[1], min, max, priv->resy * 1000, 0, priv->resy * 1000, Relative);

into

xf86InitValuatorAxisStruct(dev, 1, axes_labels[1], min, max, priv->synpara.resolution_vert * 1000, 0, priv->synpara.resolution_vert * 1000, Relative);

After that, setting both "VertResolution" and "HorizResolution" to the same value, makes the touchpad behave as expected.

But I think the real problem is somewhere deeper in getevents.c

As far as I understand the scale_for_device_resolution function tries to map the touch pad size to the screen size which works fine as long as resolution_ratio equals 1 which is the case for all pads with an equal x/y resolution and breaks on devices with uneven resolutions. But why is the resolution involved in the scaling anyway? If we try to map 1the device size to the screen size we don't need to bother about the device resolution. The axis sizes and the screen resolution should be enough?!