misprite: Do window check first for Get{Image,Spans} too

This commit is contained in:
Adam Jackson 2009-03-27 11:54:52 -04:00
parent 8beced6c02
commit 2c000f4980

View File

@ -329,21 +329,22 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
SCREEN_PROLOGUE (pScreen, GetImage); SCREEN_PROLOGUE (pScreen, GetImage);
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); if (pDrawable->type == DRAWABLE_WINDOW)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
pCursorInfo = MISPRITE(pDev); if (DevHasCursor(pDev))
if (pDrawable->type == DRAWABLE_WINDOW && {
pCursorInfo->isUp && pCursorInfo = MISPRITE(pDev);
pCursorInfo->pScreen == pScreen && if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y, ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
sx, sy, w, h)) sx, sy, w, h))
{ {
SPRITE_DEBUG (("GetImage remove\n")); SPRITE_DEBUG (("GetImage remove\n"));
miSpriteRemoveCursor (pDev, pScreen); miSpriteRemoveCursor (pDev, pScreen);
} }
}
} }
} }
@ -364,37 +365,38 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
SCREEN_PROLOGUE (pScreen, GetSpans); SCREEN_PROLOGUE (pScreen, GetSpans);
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); if (pDrawable->type == DRAWABLE_WINDOW)
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
pCursorInfo = MISPRITE(pDev); if (DevHasCursor(pDev))
if (pDrawable->type == DRAWABLE_WINDOW &&
pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen)
{ {
DDXPointPtr pts; pCursorInfo = MISPRITE(pDev);
int *widths;
int nPts;
int xorg,
yorg;
xorg = pDrawable->x; if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
yorg = pDrawable->y;
for (pts = ppt, widths = pwidth, nPts = nspans;
nPts--;
pts++, widths++)
{ {
if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg, DDXPointPtr pts;
pts->x+xorg,*widths)) int *widths;
int nPts;
int xorg,
yorg;
xorg = pDrawable->x;
yorg = pDrawable->y;
for (pts = ppt, widths = pwidth, nPts = nspans;
nPts--;
pts++, widths++)
{ {
SPRITE_DEBUG (("GetSpans remove\n")); if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
miSpriteRemoveCursor (pDev, pScreen); pts->x+xorg,*widths))
break; {
SPRITE_DEBUG (("GetSpans remove\n"));
miSpriteRemoveCursor (pDev, pScreen);
break;
}
} }
} }
} }