mieq: EQ processing handles MP devices

global: MPX define added to xorg-server.h.in

xfree86/common: small fix to avoid byte overflow
This commit is contained in:
Peter Hutterer 2006-11-16 20:43:27 +10:30 committed by Peter Hutterer
parent c957a16180
commit 5388423eb0
4 changed files with 44 additions and 2 deletions

View File

@ -37,3 +37,15 @@ Files:
hw/xfree86/common/xf86Xinput.c
include/inputstr.h
mi/mieq.c
mieq: EQ processing handles MP devices
global: MPX define added to xorg-server.h.in
xfree86/common: small fix to avoid byte overflow
Files:
mi/mieq.c
hw/xfree86/common/xf86Xinput.c
include/xserver-config.h.in

View File

@ -215,7 +215,10 @@ xf86ActivateDevice(LocalDevicePtr local)
dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
#ifdef MPX
dev->isMPDev = local->flags & XI86_MP_DEVICE;
if (local->flags & XI86_MP_DEVICE)
dev->isMPDev = TRUE;
else
dev->isMPDev = FALSE;
#endif
RegisterOtherDevice(dev);

View File

@ -142,6 +142,9 @@
/* Support X Input extension */
#undef XINPUT
/* Support MPX multipointer extension */
#undef MPX
/* Build XKB */
#undef XKB

View File

@ -24,6 +24,15 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
#ifdef MPX
/*
* MPX additions:
* Copyright © 2006 Peter Hutterer
* License see above.
* Author: Peter Hutterer <peter@cs.unisa.edu.au>
*
*/
#endif
/*
* mieq.c
@ -218,13 +227,28 @@ 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);
#ifdef MPX
if (!e->pDev->isMPDev)
#endif
SwitchCorePointer(e->pDev);
dev = inputInfo.pointer;
}
else {
dev = e->pDev;
}
#ifdef MPX
/* MPX devices send both core and Xi events. Depending on what
* event we have, dev is set to either the core pointer or the
* device. This gives us the right processing function but we need
* to pass the right device in too.
* Any device that is not a MP device is processed as usual.
*/
if (e->pDev->isMPDev)
dev->public.processInputProc(e->event, e->pDev, e->nevents);
else
#endif
dev->public.processInputProc(e->event, dev, e->nevents);
}
}