[PATCH 1/3] dix: when scaling from desktop coord, take the total desktop size (#51904)

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 30 18:56:59 PST 2013


From: Sybren van Elderen <sowmestno at msn.com>

Scaled is already in desktop coordinates, take the total width into account,
not just the current screen's width.

Fixes Xdmx pointer position calculation.

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

Signed-off-by: Sybren van Elderen <sowmestno at msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index a1e1938..8fe54d7 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -833,14 +833,14 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
         scaled = valuator_mask_get_double(mask, 0) + scr->x;
         scaled = rescaleValuatorAxis(scaled,
                                      NULL, dev->valuator->axes + 0,
-                                     0, scr->width);
+                                     screenInfo.x, screenInfo.width);
         valuator_mask_set_double(mask, 0, scaled);
     }
     if (valuator_mask_isset(mask, 1)) {
         scaled = valuator_mask_get_double(mask, 1) + scr->y;
         scaled = rescaleValuatorAxis(scaled,
                                      NULL, dev->valuator->axes + 1,
-                                     0, scr->height);
+                                     screenInfo.y, screenInfo.height);
         valuator_mask_set_double(mask, 1, scaled);
     }
 }
-- 
1.8.1



More information about the xorg-devel mailing list