From eb84c154ed38194c32651727b6dfe2d1bde4c599 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Feb 2012 10:09:44 +1000 Subject: [PATCH] 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 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- dix/getevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 2f6f06ced..68bf58c13 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -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