mi: removing MPX ifdefs

global sprite renaming in mipointer and misprite
	fixed: multiple remove cursor call in miSpriteInstallColormap
	fixed: wrong core pointer usage in miSpriteStoreColors

dix:    bugfix in CheckCursorConfinement
	removing MPX ifdefs
	removing MPX event generation (using Xi solely now)
	bugfix GrabDevice: uninitialized field in grab struct caused segfault

xfree86: removing MPX fdefs

Xi:     removing MPX protocol events
This commit is contained in:
Peter Hutterer 2006-12-18 15:33:54 +10:30 committed by Peter Hutterer
parent a96788058e
commit 03c554283e
12 changed files with 77 additions and 95 deletions

View File

@ -7,15 +7,24 @@ mi: removing MPX ifdefs
dix: bugfix in CheckCursorConfinement dix: bugfix in CheckCursorConfinement
removing MPX ifdefs removing MPX ifdefs
removing MPX event generation (using Xi solely now) removing MPX event generation (using Xi solely now)
bugfix GrabDevice: uninitialized field in grab struct caused segfault
xfree86: removing MPX fdefs
Xi: removing MPX protocol events
Files: Files:
include/inputstr.h
mi/midispcur.c mi/midispcur.c
mi/misprite.c mi/mieq.c
mi/mispritest.h
mi/mipointer.c mi/mipointer.c
dix/getevents.c mi/misprite.c
dix/events.c dix/events.c
dix/cursor.c dix/cursor.c
dix/devices.c
hw/xfree86/common/xf86Events.c
hw/xfree86/common/xf86Input.h
Xi/exevents.c
== 12.12.06 == == 12.12.06 ==
dix: Moving SpriteRec into DeviceIntRec dix: Moving SpriteRec into DeviceIntRec

View File

@ -73,12 +73,6 @@ SOFTWARE.
#include "dixgrabs.h" /* CreateGrab() */ #include "dixgrabs.h" /* CreateGrab() */
#include "scrnintstr.h" #include "scrnintstr.h"
#ifdef MPX
#include <X11/extensions/MPXconst.h>
#include <X11/extensions/MPXproto.h>
#include "mpxglobals.h"
#endif
#define WID(w) ((w) ? ((w)->drawable.id) : 0) #define WID(w) ((w) ? ((w)->drawable.id) : 0)
#define AllModifiersMask ( \ #define AllModifiersMask ( \
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
@ -124,6 +118,7 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
ValuatorClassPtr v = other->valuator; ValuatorClassPtr v = other->valuator;
deviceValuator *xV = (deviceValuator *) xE; deviceValuator *xV = (deviceValuator *) xE;
if (xE->u.u.type != DeviceValuator) { if (xE->u.u.type != DeviceValuator) {
GetSpritePosition(other, &rootX, &rootY); GetSpritePosition(other, &rootX, &rootY);
xE->u.keyButtonPointer.rootX = rootX; xE->u.keyButtonPointer.rootX = rootX;
@ -236,11 +231,7 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
if (other->fromPassiveGrab && (key == other->activatingKey)) if (other->fromPassiveGrab && (key == other->activatingKey))
deactivateDeviceGrab = TRUE; deactivateDeviceGrab = TRUE;
} else if (xE->u.u.type == DeviceButtonPress } else if (xE->u.u.type == DeviceButtonPress) {
#ifdef MPX
|| xE->u.u.type == MPXButtonPress
#endif
) {
if (!b) if (!b)
return; return;
@ -256,18 +247,11 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
b->state |= (Button1Mask >> 1) << xE->u.u.detail; b->state |= (Button1Mask >> 1) << xE->u.u.detail;
SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify); SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
#ifdef MPX if (!grab)
if (xE->u.u.type == DeviceButtonPress) if (CheckDeviceGrabs(other, xE, 0, count))
#endif return;
if (!grab)
if (CheckDeviceGrabs(other, xE, 0, count))
return;
} else if (xE->u.u.type == DeviceButtonRelease } else if (xE->u.u.type == DeviceButtonRelease) {
#ifdef MPX
|| xE->u.u.type == MPXButtonRelease
#endif
) {
if (!b) if (!b)
return; return;
@ -283,11 +267,8 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
if (xE->u.u.detail <= 5) if (xE->u.u.detail <= 5)
b->state &= ~((Button1Mask >> 1) << xE->u.u.detail); b->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify); SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
#ifdef MPX if (!b->state && other->fromPassiveGrab)
if (xE->u.u.type == DeviceButtonRelease) deactivateDeviceGrab = TRUE;
#endif
if (!b->state && other->fromPassiveGrab)
deactivateDeviceGrab = TRUE;
} else if (xE->u.u.type == ProximityIn) } else if (xE->u.u.type == ProximityIn)
other->valuator->mode &= ~OutOfProximity; other->valuator->mode &= ~OutOfProximity;
else if (xE->u.u.type == ProximityOut) else if (xE->u.u.type == ProximityOut)

View File

@ -120,22 +120,22 @@ FreeCursor(pointer value, XID cid)
/* FIXME: MPX: When FreeClientRessources is called, it calls FreeCursor /* FIXME: MPX: When FreeClientRessources is called, it calls FreeCursor
* too often. Refcnt gots < 0 and FreeCursorBits segfaults because the * too often. Refcnt gots < 0 and FreeCursorBits segfaults because the
* memory is already freed. */ * memory is already freed. */
MPXDBG("freecursor refcount %d\n", pCurs->refcnt);
if ( --pCurs->refcnt != 0) if ( --pCurs->refcnt != 0)
return(Success); return(Success);
pDev = inputInfo.pointer;
for (nscr = 0; nscr < screenInfo.numScreens; nscr++) for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
{ {
pscr = screenInfo.screens[nscr]; pscr = screenInfo.screens[nscr];
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
(void)( *pscr->UnrealizeCursor)(pDev, pscr, pCurs); (void)( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
} }
} }
FreeCursorBits(pCurs->bits); FreeCursorBits(pCurs->bits);
xfree( pCurs); xfree( pCurs);
MPXDBG("freeing memory for cursor\n");
return(Success); return(Success);
} }
@ -219,7 +219,6 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
pCurs->backGreen = backGreen; pCurs->backGreen = backGreen;
pCurs->backBlue = backBlue; pCurs->backBlue = backBlue;
pDev = inputInfo.pointer;
/* /*
* realize the cursor for every screen * realize the cursor for every screen
*/ */
@ -228,7 +227,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
pscr = screenInfo.screens[nscr]; pscr = screenInfo.screens[nscr];
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs)) if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
{ {
@ -241,7 +240,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/ DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/
while(pDevIt && pDevIt != pDev) while(pDevIt && pDevIt != pDev)
{ {
if (MPHasCursor(pDevIt)) if (DevHasCursor(pDevIt))
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs); ( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
pDevIt = pDevIt->next; pDevIt = pDevIt->next;
} }
@ -252,7 +251,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
pDevIt = inputInfo.devices; pDevIt = inputInfo.devices;
while (pDevIt) while (pDevIt)
{ {
if (MPHasCursor(pDevIt)) if (DevHasCursor(pDevIt))
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs); ( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
pDevIt = pDevIt->next; pDevIt = pDevIt->next;
} }
@ -439,7 +438,6 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
pCurs->backGreen = backGreen; pCurs->backGreen = backGreen;
pCurs->backBlue = backBlue; pCurs->backBlue = backBlue;
pDev = inputInfo.pointer;
/* /*
* realize the cursor for every screen * realize the cursor for every screen
*/ */
@ -448,7 +446,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
pscr = screenInfo.screens[nscr]; pscr = screenInfo.screens[nscr];
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs)) if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
{ {
@ -461,7 +459,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/ DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/
while(pDevIt && pDevIt != pDev) while(pDevIt && pDevIt != pDev)
{ {
if (MPHasCursor(pDevIt)) if (DevHasCursor(pDevIt))
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs); ( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
pDevIt = pDevIt->next; pDevIt = pDevIt->next;
} }
@ -472,7 +470,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
pDevIt = inputInfo.devices; pDevIt = inputInfo.devices;
while (pDevIt) while (pDevIt)
{ {
if (MPHasCursor(pDevIt)) if (DevHasCursor(pDevIt))
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs); ( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
pDevIt = pDevIt->next; pDevIt = pDevIt->next;
} }

View File

@ -497,6 +497,9 @@ CloseDevice(register DeviceIntPtr dev)
while (dev->xkb_interest) while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
#endif #endif
if (DevHasCursor(dev))
xfree((pointer)dev->pSprite);
xfree(dev->sync.event); xfree(dev->sync.event);
xfree(dev); xfree(dev);

View File

@ -175,8 +175,6 @@ xEvent *xeviexE;
#include "dixgrabs.h" #include "dixgrabs.h"
#include "dispatch.h" #include "dispatch.h"
#include "mpxglobals.h"
#define EXTENSION_EVENT_BASE 64 #define EXTENSION_EVENT_BASE 64
#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ #define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */
@ -243,15 +241,13 @@ static int spriteTraceSize = 0;
static int spriteTraceGood; static int spriteTraceGood;
#define MPXDBG(...) fprintf (stderr, "MPX: " __VA_ARGS__)
/** /**
* True for the core pointer and any MPX device. * True for the core pointer and any MPX device.
* False for any other device (including keyboards). * False for any other device (including keyboards).
* Does ID checking for sane range as well. * Does ID checking for sane range as well.
*/ */
_X_EXPORT Bool _X_EXPORT Bool
MPHasCursor(DeviceIntPtr pDev) DevHasCursor(DeviceIntPtr pDev)
{ {
return (pDev == inputInfo.pointer || return (pDev == inputInfo.pointer ||
(pDev->isMPDev && pDev->id < MAX_DEVICES)); (pDev->isMPDev && pDev->id < MAX_DEVICES));
@ -1210,7 +1206,7 @@ playmore:
syncEvents.playingEvents = FALSE; syncEvents.playingEvents = FALSE;
for (dev = inputInfo.devices; dev; dev = dev->next) for (dev = inputInfo.devices; dev; dev = dev->next)
{ {
if (MPHasCursor(dev)) if (DevHasCursor(dev))
{ {
/* the following may have been skipped during replay, /* the following may have been skipped during replay,
so do it now */ so do it now */
@ -1315,7 +1311,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
mouse->activeGrab = *grab; mouse->activeGrab = *grab;
mouse->grab = &mouse->activeGrab; mouse->grab = &mouse->activeGrab;
mouse->fromPassiveGrab = autoGrab; mouse->fromPassiveGrab = autoGrab;
PostNewCursor(inputInfo.pointer); PostNewCursor(mouse);
CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode);
} }
@ -1876,9 +1872,6 @@ DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab,
register OtherInputMasks *inputMasks; register OtherInputMasks *inputMasks;
int mskidx = dev->id; int mskidx = dev->id;
if (IsMPXEvent(xE))
mskidx = MPXmskidx;
inputMasks = wOtherInputMasks(pWin); inputMasks = wOtherInputMasks(pWin);
if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx])) if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx]))
return 0; return 0;
@ -2082,7 +2075,7 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
xeviehot.y = pSprite->hot.y; xeviehot.y = pSprite->hot.y;
#endif #endif
pSprite->hotPhys = pSprite->hot; pSprite->hotPhys = pSprite->hot;
#if !defined MPX
if ((pSprite->hotPhys.x != XE_KBPTR.rootX) || if ((pSprite->hotPhys.x != XE_KBPTR.rootX) ||
(pSprite->hotPhys.y != XE_KBPTR.rootY)) (pSprite->hotPhys.y != XE_KBPTR.rootY))
{ {
@ -2090,7 +2083,7 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
pDev, pSprite->hotPhys.pScreen, pDev, pSprite->hotPhys.pScreen,
pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE); pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
} }
#endif
XE_KBPTR.rootX = pSprite->hot.x; XE_KBPTR.rootX = pSprite->hot.x;
XE_KBPTR.rootY = pSprite->hot.y; XE_KBPTR.rootY = pSprite->hot.y;
} }
@ -2127,7 +2120,7 @@ WindowsRestructured()
DeviceIntPtr pDev = inputInfo.devices; DeviceIntPtr pDev = inputInfo.devices;
while(pDev) while(pDev)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
CheckMotion((xEvent *)NULL, pDev); CheckMotion((xEvent *)NULL, pDev);
pDev = pDev->next; pDev = pDev->next;
} }
@ -2150,7 +2143,7 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
pDev = inputInfo.devices; pDev = inputInfo.devices;
while(pDev) while(pDev)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pSprite = pDev->pSprite; pSprite = pDev->pSprite;
pSprite->hot.x -= xoff; pSprite->hot.x -= xoff;
@ -2196,7 +2189,7 @@ DefineInitialRootWindow(register WindowPtr win)
while (pDev) while (pDev)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pSprite = pDev->pSprite; pSprite = pDev->pSprite;
@ -2257,7 +2250,11 @@ DefineInitialRootWindow(register WindowPtr win)
void void
WindowHasNewCursor(WindowPtr pWin) WindowHasNewCursor(WindowPtr pWin)
{ {
PostNewCursor(inputInfo.pointer); DeviceIntPtr pDev;
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (DevHasCursor(pDev))
PostNewCursor(pDev);
} }
_X_EXPORT void _X_EXPORT void
@ -2996,7 +2993,6 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
register ButtonClassPtr butc = mouse->button; register ButtonClassPtr butc = mouse->button;
SpritePtr pSprite = mouse->pSprite; SpritePtr pSprite = mouse->pSprite;
#ifdef XKB #ifdef XKB
XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo;
#endif #endif
@ -3997,6 +3993,9 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
{ {
GrabRec tempGrab; GrabRec tempGrab;
/* Otherwise segfaults happen on grabbed MPX devices */
memset(&tempGrab, 0, sizeof(GrabRec));
tempGrab.window = pWin; tempGrab.window = pWin;
tempGrab.resource = client->clientAsMask; tempGrab.resource = client->clientAsMask;
tempGrab.ownerEvents = ownerEvents; tempGrab.ownerEvents = ownerEvents;
@ -4004,6 +4003,8 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
tempGrab.pointerMode = other_mode; tempGrab.pointerMode = other_mode;
tempGrab.eventMask = mask; tempGrab.eventMask = mask;
tempGrab.device = dev; tempGrab.device = dev;
tempGrab.cursor = NULL;
(*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE);
*status = GrabSuccess; *status = GrabSuccess;
} }
@ -4589,7 +4590,7 @@ CheckCursorConfinement(WindowPtr pWin)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
grab = pDev->grab; grab = pDev->grab;
if (grab && (confineTo = grab->confineTo)) if (grab && (confineTo = grab->confineTo))

View File

@ -246,11 +246,8 @@ ProcessInputEvents ()
xf86Info.inputPending = FALSE; xf86Info.inputPending = FALSE;
mieqProcessInputEvents(); mieqProcessInputEvents();
#ifndef MPX
/* For MPX, this is done inside the mieqProcessInputEvents() */
miPointerUpdateSprite(inputInfo.pointer);
#endif
/* FIXME: This is a problem if we have multiple pointers */
miPointerGetPosition(inputInfo.pointer, &x, &y); miPointerGetPosition(inputInfo.pointer, &x, &y);
xf86SetViewport(xf86Info.currentScreen, x, y); xf86SetViewport(xf86Info.currentScreen, x, y);
} }

View File

@ -82,10 +82,7 @@
#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */ #define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */ #define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */ #define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
#ifdef MPX
#define XI86_MP_DEVICE 0x100 /* device is multipointer device */ #define XI86_MP_DEVICE 0x100 /* device is multipointer device */
#endif
#define XI_PRIVATE(dev) \ #define XI_PRIVATE(dev) \
(((LocalDevicePtr)((dev)->public.devicePrivate))->private) (((LocalDevicePtr)((dev)->public.devicePrivate))->private)

View File

@ -379,4 +379,5 @@ typedef struct _QdEvent {
int evcount; int evcount;
} QdEventRec; } QdEventRec;
#define MPXDBG(...) ErrorF("MPX: " __VA_ARGS__ )
#endif /* INPUTSTRUCT_H */ #endif /* INPUTSTRUCT_H */

View File

@ -538,7 +538,7 @@ miDCPutUpCursor (pDev, pScreen, pCursor, x, y, source, mask)
pWin = WindowTable[pScreen->myNum]; pWin = WindowTable[pScreen->myNum];
pBuffer = pScreenPriv->pCoreBuffer; pBuffer = pScreenPriv->pCoreBuffer;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id]; pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
#ifdef ARGB_CURSOR #ifdef ARGB_CURSOR
@ -589,7 +589,7 @@ miDCSaveUnderCursor (pDev, pScreen, x, y, w, h)
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
pBuffer = pScreenPriv->pCoreBuffer; pBuffer = pScreenPriv->pCoreBuffer;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id]; pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
pSave = pBuffer->pSave; pSave = pBuffer->pSave;
@ -628,7 +628,7 @@ miDCRestoreUnderCursor (pDev, pScreen, x, y, w, h)
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
pBuffer = pScreenPriv->pCoreBuffer; pBuffer = pScreenPriv->pCoreBuffer;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id]; pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
pSave = pBuffer->pSave; pSave = pBuffer->pSave;
@ -661,7 +661,7 @@ miDCChangeSave (pDev, pScreen, x, y, w, h, dx, dy)
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
pBuffer = pScreenPriv->pCoreBuffer; pBuffer = pScreenPriv->pCoreBuffer;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id]; pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
pSave = pBuffer->pSave; pSave = pBuffer->pSave;
@ -812,7 +812,7 @@ miDCMoveCursor (pDev, pScreen, pCursor, x, y, w, h, dx, dy, source, mask)
pWin = WindowTable[pScreen->myNum]; pWin = WindowTable[pScreen->myNum];
pBuffer = pScreenPriv->pCoreBuffer; pBuffer = pScreenPriv->pCoreBuffer;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id]; pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
pTemp = pBuffer->pTemp; pTemp = pBuffer->pTemp;

View File

@ -227,9 +227,7 @@ mieqProcessInputEvents()
else if (e->event[0].u.u.type == MotionNotify || else if (e->event[0].u.u.type == MotionNotify ||
e->event[0].u.u.type == ButtonPress || e->event[0].u.u.type == ButtonPress ||
e->event[0].u.u.type == ButtonRelease) { e->event[0].u.u.type == ButtonRelease) {
#ifdef MPX
if (!e->pDev->isMPDev) if (!e->pDev->isMPDev)
#endif
SwitchCorePointer(e->pDev); SwitchCorePointer(e->pDev);
dev = inputInfo.pointer; dev = inputInfo.pointer;
@ -238,7 +236,6 @@ mieqProcessInputEvents()
dev = e->pDev; dev = e->pDev;
} }
#ifdef MPX
/* MPX devices send both core and Xi events. /* MPX devices send both core and Xi events.
* Use dev to get the correct processing function but supply * Use dev to get the correct processing function but supply
* e->pDev to pass the correct device * e->pDev to pass the correct device
@ -246,16 +243,14 @@ mieqProcessInputEvents()
if (e->pDev->isMPDev) if (e->pDev->isMPDev)
dev->public.processInputProc(e->event, e->pDev, e->nevents); dev->public.processInputProc(e->event, e->pDev, e->nevents);
else else
#endif dev->public.processInputProc(e->event, dev, e->nevents);
dev->public.processInputProc(e->event, dev, e->nevents);
} }
#ifdef MPX
/* Update the sprite now. Next event may be from different device. */ /* Update the sprite now. Next event may be from different device. */
if (e->event[0].u.u.type == MotionNotify && if (e->event[0].u.u.type == MotionNotify &&
(e->pDev->isMPDev || e->pDev->coreEvents)) (e->pDev->isMPDev || e->pDev->coreEvents))
{ {
miPointerUpdateSprite(e->pDev); miPointerUpdateSprite(e->pDev);
} }
#endif
} }
} }

View File

@ -70,7 +70,7 @@ static miPointerPtr miCorePointer;
*/ */
static miPointerRec miPointers[MAX_DEVICES]; static miPointerRec miPointers[MAX_DEVICES];
#define MIPOINTER(dev) \ #define MIPOINTER(dev) \
(MPHasCursor((dev))) ? &miPointers[(dev)->id] : miCorePointer (DevHasCursor((dev))) ? &miPointers[(dev)->id] : miCorePointer
static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor); CursorPtr pCursor);

View File

@ -152,7 +152,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
@ -318,7 +318,7 @@ miSpriteCloseScreen (i, pScreen)
pScreen->SaveDoomedAreas = pScreenPriv->SaveDoomedAreas; pScreen->SaveDoomedAreas = pScreenPriv->SaveDoomedAreas;
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
miCursorInfoPtr pCursor; miCursorInfoPtr pCursor;
pCursor = &pScreenPriv->pDevCursors[pDev->id]; pCursor = &pScreenPriv->pDevCursors[pDev->id];
@ -352,7 +352,7 @@ miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
if (pDrawable->type == DRAWABLE_WINDOW && if (pDrawable->type == DRAWABLE_WINDOW &&
@ -392,7 +392,7 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
@ -444,7 +444,7 @@ miSpriteSourceValidate (pDrawable, x, y, width, height)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp && if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
@ -477,7 +477,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
/* /*
@ -518,7 +518,7 @@ miSpriteBlockHandler (i, blockData, pTimeout, pReadmask)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pPriv->pDevCursors[pDev->id]; pCursorInfo = &pPriv->pDevCursors[pDev->id];
if (!pCursorInfo->isUp && pCursorInfo->shouldBeUp) if (!pCursorInfo->isUp && pCursorInfo->shouldBeUp)
@ -612,7 +612,7 @@ miSpriteStoreColors (pMap, ndef, pdef)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
{ {
pCursorInfo = &pPriv->pDevCursors[pDev->id]; pCursorInfo = &pPriv->pDevCursors[pDev->id];
if (pCursorInfo->pColormap == pMap) if (pCursorInfo->pColormap == pMap)
@ -721,7 +721,7 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if(MPHasCursor(pDev)) if(DevHasCursor(pDev))
{ {
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
if (pCursorInfo->isUp) if (pCursorInfo->isUp)
@ -765,7 +765,7 @@ miSpriteRealizeCursor (pDev, pScreen, pCursor)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = pScreenPriv->cp; pCursorInfo = pScreenPriv->cp;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
if (pCursor == pCursorInfo->pCursor) if (pCursor == pCursorInfo->pCursor)
@ -799,7 +799,7 @@ miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
miCursorInfoPtr pPointer = pScreenPriv->cp; miCursorInfoPtr pPointer = pScreenPriv->cp;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pPointer = &pScreenPriv->pDevCursors[pDev->id]; pPointer = &pScreenPriv->pDevCursors[pDev->id];
if (!pCursor) if (!pCursor)
@ -916,7 +916,7 @@ miSpriteMoveCursor (pDev, pScreen, x, y)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursor = pScreenPriv->cp->pCursor; pCursor = pScreenPriv->cp->pCursor;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pCursor = pScreenPriv->pDevCursors[pDev->id].pCursor; pCursor = pScreenPriv->pDevCursors[pDev->id].pCursor;
miSpriteSetCursor (pDev, pScreen, pCursor, x, y); miSpriteSetCursor (pDev, pScreen, pCursor, x, y);
@ -939,7 +939,7 @@ miSpriteRemoveCursor (pDev, pScreen)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = pScreenPriv->cp; pCursorInfo = pScreenPriv->cp;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
miSpriteIsUpFALSE (pCursorInfo, pScreen, pScreenPriv); miSpriteIsUpFALSE (pCursorInfo, pScreen, pScreenPriv);
@ -977,7 +977,7 @@ miSpriteRestoreCursor (pDev, pScreen)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = pScreenPriv->cp; pCursorInfo = pScreenPriv->cp;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
miSpriteComputeSaved (pDev, pScreen); miSpriteComputeSaved (pDev, pScreen);
@ -1025,7 +1025,7 @@ miSpriteComputeSaved (pDev, pScreen)
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
pCursorInfo = pScreenPriv->cp; pCursorInfo = pScreenPriv->cp;
if (MPHasCursor(pDev)) if (DevHasCursor(pDev))
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id]; pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
pCursor = pCursorInfo->pCursor; pCursor = pCursorInfo->pCursor;