diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-12-11 10:32:45 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-01-05 09:53:47 +1000 |
commit | ee21be1324de1d6ef14e529fed7b75992e971beb (patch) | |
tree | eed4aa33fc0beb35f68950d98cbb54d3749931d8 /dix | |
parent | dc777c346d5d452a53b13b917c45f6a1bad2f20b (diff) |
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 <http://bugs.freedesktop.org/show_bug.cgi?id=86655>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/getevents.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index dd9626526..6fb12c5c1 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; @@ -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? */ event_set_root_coordinates(event, - dev->last.valuators[0], - dev->last.valuators[1]); + dev->last.valuators[0] - scr->x, + dev->last.valuators[1] - scr->y); event->touchid = ti->client_id; event->flags = flags; |