diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-11-16 15:11:14 +1030 |
---|---|---|
committer | Peter Hutterer <whot@hyena.localdomain> | 2006-11-16 15:11:14 +1030 |
commit | c957a16180810fbd58526e1a670d82384fb4a61d (patch) | |
tree | fa42237fd37f7294a93feaf9727fb131c82747cf | |
parent | 7ce2dc57844872cc340b60387d4d1cb3d982633e (diff) |
dix: added isMPdev field to _DeviceIntRec, is used in GetPointerEvents()
mieq: avoid merging events from different devices in mieqEnqueue()
xfree86/common
isMPdev field used from xf86ActivateDevice(), xf86PostMotionEvent()
and xf86PostButtonEvent()
-rw-r--r-- | Changelog | 14 | ||||
-rw-r--r-- | dix/getevents.c | 5 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 6 | ||||
-rw-r--r-- | include/inputstr.h | 3 | ||||
-rw-r--r-- | mi/mieq.c | 6 |
5 files changed, 31 insertions, 3 deletions
@@ -23,3 +23,17 @@ Files: configure.ac include/dix-config.h.in + +dix: added isMPdev field to _DeviceIntRec, is used in GetPointerEvents() + +mieq: avoid merging events from different devices in mieqEnqueue() + +xfree86/common + isMPdev field used from xf86ActivateDevice(), xf86PostMotionEvent() + and xf86PostButtonEvent() + +Files: + dix/getevents.c + hw/xfree86/common/xf86Xinput.c + include/inputstr.h + mi/mieq.c diff --git a/dix/getevents.c b/dix/getevents.c index eb3c2a58c..9c7b7230b 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -636,7 +636,12 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, num_valuators, valuators); } +#ifdef MPX + /* MPX devices always send core events */ + if (pDev->coreEvents || pDev->isMPDev) { +#else if (pDev->coreEvents) { +#endif events->u.u.type = type; events->u.keyButtonPointer.time = ms; events->u.keyButtonPointer.rootX = x; diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 0dc392a5c..888ad4235 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -215,7 +215,7 @@ xf86ActivateDevice(LocalDevicePtr local) dev->coreEvents = local->flags & XI86_ALWAYS_CORE; #ifdef MPX - dev->coreEvents |= local->flags & XI86_MP_DEVICE; + dev->isMPDev = local->flags & XI86_MP_DEVICE; #endif RegisterOtherDevice(dev); @@ -464,7 +464,7 @@ xf86PostMotionEvent(DeviceIntPtr device, flags = POINTER_RELATIVE | POINTER_ACCELERATE; #ifdef MPX - if (device->coreEvents & XI86_MP_DEVICE) + if (device->isMPDev) flags |= POINTER_MULTIPOINTER; #endif @@ -541,7 +541,7 @@ xf86PostButtonEvent(DeviceIntPtr device, flags = POINTER_RELATIVE; #ifdef MPX - if (device->coreEvents & XI86_MP_DEVICE) + if (device->isMPDev) flags |= POINTER_MULTIPOINTER; #endif diff --git a/include/inputstr.h b/include/inputstr.h index ada94e6b4..231dffc3e 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -288,6 +288,9 @@ typedef struct _DeviceIntRec { Bool inited; /* TRUE if INIT returns Success */ Bool enabled; /* TRUE if ON returns Success */ Bool coreEvents; /* TRUE if device also sends core */ +#ifdef MPX + Bool isMPDev; /* TRUE if multipointer device */ +#endif GrabPtr grab; /* the grabber - used by DIX */ struct { Bool frozen; @@ -101,6 +101,12 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e) deviceKeyButtonPointer *lastkbp = (deviceKeyButtonPointer *) &laste->event[0]; +#ifdef MPX + /* avoid merging events from different devices */ + if (e->u.u.type == MotionNotify && pDev->isMPDev) + isMotion = pDev->id; + else +#endif if (e->u.u.type == MotionNotify) isMotion = inputInfo.pointer->id; else if (e->u.u.type == DeviceMotionNotify) |