对于将来可能遇到此问题的任何人,我们的团队很久以前就提出了一个小补丁,以防万一它可能有用...
---
dix/events.c | 21 +++++++++++++++++++--
mi/mieq.c | 26 ++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/dix/events.c b/dix/events.c
index 8efdf18..5155ef5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2999,8 +2999,25 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
/* Motion events entering DIX get translated to Screen 0
coordinates. Replayed events have already been
translated since they've entered DIX before */
- ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
- ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
+
+ /*Now we take into account inputs comming from MT device that uses absolutes coordinates.*/
+ switch (ev->type) {
+ case ET_Motion:
+ case ET_KeyPress:
+ case ET_KeyRelease:
+ case ET_ButtonPress:
+ case ET_ButtonRelease:
+ ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+ ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
+ break;
+ case ET_TouchBegin:
+ case ET_TouchUpdate:
+ case ET_TouchEnd:
+ ev->root_x -= screenInfo.screens[0]->x;
+ ev->root_y -= screenInfo.screens[0]->y;
+ break;
+
+ }
}
else
#endif
diff --git a/mi/mieq.c b/mi/mieq.c
index 05447d6..cc151f6 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -447,6 +447,32 @@ mieqMoveToNewScreen(DeviceIntPtr dev, ScreenPtr screen, DeviceEvent *event)
DequeueScreen(dev) = screen;
x = event->root_x;
y = event->root_y;
+
+
+ /*Now we take into account inputs comming from MT device that uses absolutes coordinates.*/
+ switch (event->type) {
+ case ET_Motion:
+ case ET_KeyPress:
+ case ET_KeyRelease:
+ case ET_ButtonPress:
+ case ET_ButtonRelease:
+ // print
+ break;
+ case ET_TouchBegin:
+ case ET_TouchUpdate:
+ case ET_TouchEnd:
+ {
+ ScreenPtr screenPtr = dev->spriteInfo->sprite->pDequeueScreen;
+ x -= screenPtr->x;
+ y -= screenPtr->y;
+ NewCurrentScreen(dev, screenPtr, x, y);
+ return;
+ // break;
+ }
+ default:
+ break;
+ }
+
NewCurrentScreen(dev, DequeueScreen(dev), x, y);
}
}