summaryrefslogtreecommitdiff
path: root/mi/mieq.c
diff options
context:
space:
mode:
Diffstat (limited to 'mi/mieq.c')
-rw-r--r--mi/mieq.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 5bd87ebdb..9c670612a 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -24,6 +24,13 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
+ /*
+ * MPX additions:
+ * Copyright © 2006 Peter Hutterer
+ * License see above.
+ * Author: Peter Hutterer <peter@cs.unisa.edu.au>
+ *
+ */
/*
* mieq.c
@@ -112,10 +119,13 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
deviceKeyButtonPointer *lastkbp = (deviceKeyButtonPointer *)
&laste->event[0];
+ /* avoid merging events from different devices */
if (e->u.u.type == MotionNotify)
+ isMotion = pDev->id;
+ else if (e->u.u.type == MotionNotify)
isMotion = inputInfo.pointer->id;
else if (e->u.u.type == DeviceMotionNotify)
- isMotion = pDev->id;
+ isMotion = pDev->id | (1 << 8); /* flag to indicate DeviceMotion */
/* We silently steal valuator events: just tack them on to the last
* motion event they need to be attached to. Sigh. */
@@ -222,7 +232,7 @@ mieqProcessInputEvents()
miEventQueue.head = 0;
else
++miEventQueue.head;
- NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
+ NewCurrentScreen (e->pDev, miEventQueue.pDequeueScreen, x, y);
}
else {
if (miEventQueue.head == QUEUE_SIZE - 1)
@@ -249,14 +259,23 @@ mieqProcessInputEvents()
else if (e->event[0].u.u.type == MotionNotify ||
e->event[0].u.u.type == ButtonPress ||
e->event[0].u.u.type == ButtonRelease) {
- SwitchCorePointer(e->pDev);
dev = inputInfo.pointer;
}
else {
dev = e->pDev;
}
- dev->public.processInputProc(e->event, dev, e->nevents);
+ /* MPX devices send both core and Xi events.
+ * Use dev to get the correct processing function but supply
+ * e->pDev to pass the correct device
+ */
+ dev->public.processInputProc(e->event, e->pDev, e->nevents);
+ }
+
+ /* Update the sprite now. Next event may be from different device. */
+ if (e->event[0].u.u.type == MotionNotify && e->pDev->coreEvents)
+ {
+ miPointerUpdateSprite(e->pDev);
}
}
}