Commit ee21be13 authored by Peter Hutterer's avatar Peter Hutterer

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

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 <>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
parent dc777c34
......@@ -2044,7 +2044,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
event->root = scr->root->;
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;
......@@ -2082,8 +2082,8 @@ GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti,
/* Get screen event coordinates from the sprite. Is this really the best
* we can do? */
dev->last.valuators[0] - scr->x,
dev->last.valuators[1] - scr->y);
event->touchid = ti->client_id;
event->flags = flags;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment