When button zones are in use, the code attempts to calculate which
zone the finger is in. The left and right edges of the zones are
calculated according the nths of pad_width, where n is the number of
zones.
These left and right sides are compared with `pos', and the zone is
the one where left<=pos<=right.
This would all be correct if pos were the touch's x coordinate.
However, inexplicably, it isn't: it has had pad_width/2 added.
The git history does not reveal an explanation for adding pad_width/2.
Removing it makes the button zones work.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
if (zones > 0) {
width = ((double)cfg->pad_width)/((double)zones);
- pos = cfg->pad_width / 2 + ms->touch[earliest].x;
+ pos = ms->touch[earliest].x;
#ifdef DEBUG_GESTURES
xf86Msg(X_INFO, "buttons_update: pad width %d, zones %d, zone width %f, x %d\n",
cfg->pad_width, zones, width, pos);