dix: when rescaling from master, rescale from desktop dimensions (#46657)

master->last.valuators[] is in desktop dimensions, so use those as
rescale axis ranges, not the screen. Otherwise, a rescale on any screen
not the top-left will cause out-of-bounds coordinates which will always
map to the bottom-right screen, causing the device to be stuck on that
screen.

X.Org Bug 46657 <http://bugs.freedesktop.org/show_bug.cgi?id=46657>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
Peter Hutterer 2012-02-27 10:09:44 +10:00
parent 6b6afd3d01
commit eb84c154ed

View File

@ -345,13 +345,15 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0],
NULL,
pDev->valuator->axes + 0,
0, scr->width);
screenInfo.x,
screenInfo.width);
}
if (pDev->valuator->numAxes > 1) {
pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1],
NULL,
pDev->valuator->axes + 1,
0, scr->height);
screenInfo.y,
screenInfo.height);
}
/* calculate the other axis as well based on info from the old