[PATCH] dix: offset touch root coordinates by ScreenRec origins (#86655)

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 10 16:36:01 PST 2014


For two ScreenRecs abs pointer positioning was working fine, but touch events
stuck to the lower/right edge on any screen but the one with a 0/0 origin.
Cause is a missing offset by the screen coordinates, causing the root
coordinates in the event to desktop-wide, not screen-wide.

Offset properly, just like we do for pointer events.

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

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index dd96265..6684ddc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -2044,7 +2044,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
 
     event->root = scr->root->drawable.id;
 
-    event_set_root_coordinates(event, screenx, screeny);
+    event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y);
     event->touchid = client_id;
     event->flags = flags;
 
-- 
2.1.0



More information about the xorg-devel mailing list