events.c: make XEvIE a little less verbose
Change a lot of: #ifdef XEVIE xeviehot.x = #endif sprite.hot.x = ... #ifdef XEVIE xeviehot.y = #endif sprite.hot.y = ... to one single #ifdef XEVIE xeviehot.x = sprite.hot.x; xeviehot.y = sprite.hot.y; #endif at the end of the functions.
This commit is contained in:
parent
c6c39afde3
commit
95dbfcf882
89
dix/events.c
89
dix/events.c
|
@ -462,13 +462,7 @@ XineramaCheckVirtualMotion(
|
||||||
if (qe)
|
if (qe)
|
||||||
{
|
{
|
||||||
sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
|
sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
||||||
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
||||||
NullWindow;
|
NullWindow;
|
||||||
|
@ -505,24 +499,12 @@ XineramaCheckVirtualMotion(
|
||||||
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
|
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
|
||||||
|
|
||||||
if (sprite.hot.x < lims.x1)
|
if (sprite.hot.x < lims.x1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = lims.x1;
|
sprite.hot.x = lims.x1;
|
||||||
else if (sprite.hot.x >= lims.x2)
|
else if (sprite.hot.x >= lims.x2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = lims.x2 - 1;
|
sprite.hot.x = lims.x2 - 1;
|
||||||
if (sprite.hot.y < lims.y1)
|
if (sprite.hot.y < lims.y1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = lims.y1;
|
sprite.hot.y = lims.y1;
|
||||||
else if (sprite.hot.y >= lims.y2)
|
else if (sprite.hot.y >= lims.y2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = lims.y2 - 1;
|
sprite.hot.y = lims.y2 - 1;
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
|
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
|
||||||
|
@ -535,6 +517,10 @@ XineramaCheckVirtualMotion(
|
||||||
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
|
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef XEVIE
|
||||||
|
xeviehot.x = sprite.hot.x;
|
||||||
|
xeviehot.y = sprite.hot.y;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -552,33 +538,15 @@ XineramaCheckMotion(xEvent *xE)
|
||||||
panoramiXdataPtr[0].x;
|
panoramiXdataPtr[0].x;
|
||||||
XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
|
XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
|
||||||
panoramiXdataPtr[0].y;
|
panoramiXdataPtr[0].y;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = XE_KBPTR.rootX;
|
sprite.hot.x = XE_KBPTR.rootX;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = XE_KBPTR.rootY;
|
sprite.hot.y = XE_KBPTR.rootY;
|
||||||
if (sprite.hot.x < sprite.physLimits.x1)
|
if (sprite.hot.x < sprite.physLimits.x1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = sprite.physLimits.x1;
|
sprite.hot.x = sprite.physLimits.x1;
|
||||||
else if (sprite.hot.x >= sprite.physLimits.x2)
|
else if (sprite.hot.x >= sprite.physLimits.x2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = sprite.physLimits.x2 - 1;
|
sprite.hot.x = sprite.physLimits.x2 - 1;
|
||||||
if (sprite.hot.y < sprite.physLimits.y1)
|
if (sprite.hot.y < sprite.physLimits.y1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = sprite.physLimits.y1;
|
sprite.hot.y = sprite.physLimits.y1;
|
||||||
else if (sprite.hot.y >= sprite.physLimits.y2)
|
else if (sprite.hot.y >= sprite.physLimits.y2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = sprite.physLimits.y2 - 1;
|
sprite.hot.y = sprite.physLimits.y2 - 1;
|
||||||
|
|
||||||
if (sprite.hotShape)
|
if (sprite.hotShape)
|
||||||
|
@ -596,6 +564,8 @@ XineramaCheckMotion(xEvent *xE)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XEVIE
|
#ifdef XEVIE
|
||||||
|
xeviehot.x = sprite.hot.x;
|
||||||
|
xeviehot.y = sprite.hot.y;
|
||||||
xeviewin =
|
xeviewin =
|
||||||
#endif
|
#endif
|
||||||
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
|
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
|
||||||
|
@ -821,13 +791,7 @@ CheckVirtualMotion(
|
||||||
if (qe)
|
if (qe)
|
||||||
{
|
{
|
||||||
sprite.hot.pScreen = qe->pScreen;
|
sprite.hot.pScreen = qe->pScreen;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
||||||
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
||||||
NullWindow;
|
NullWindow;
|
||||||
|
@ -839,31 +803,16 @@ CheckVirtualMotion(
|
||||||
if (sprite.hot.pScreen != pWin->drawable.pScreen)
|
if (sprite.hot.pScreen != pWin->drawable.pScreen)
|
||||||
{
|
{
|
||||||
sprite.hot.pScreen = pWin->drawable.pScreen;
|
sprite.hot.pScreen = pWin->drawable.pScreen;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x = xeviehot.y = 0;
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = sprite.hot.y = 0;
|
sprite.hot.x = sprite.hot.y = 0;
|
||||||
}
|
}
|
||||||
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
|
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
|
||||||
if (sprite.hot.x < lims.x1)
|
if (sprite.hot.x < lims.x1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = lims.x1;
|
sprite.hot.x = lims.x1;
|
||||||
else if (sprite.hot.x >= lims.x2)
|
else if (sprite.hot.x >= lims.x2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = lims.x2 - 1;
|
sprite.hot.x = lims.x2 - 1;
|
||||||
if (sprite.hot.y < lims.y1)
|
if (sprite.hot.y < lims.y1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = lims.y1;
|
sprite.hot.y = lims.y1;
|
||||||
else if (sprite.hot.y >= lims.y2)
|
else if (sprite.hot.y >= lims.y2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = lims.y2 - 1;
|
sprite.hot.y = lims.y2 - 1;
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (wBoundingShape(pWin))
|
if (wBoundingShape(pWin))
|
||||||
|
@ -876,6 +825,10 @@ CheckVirtualMotion(
|
||||||
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
|
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef XEVIE
|
||||||
|
xeviehot.x = sprite.hot.x;
|
||||||
|
xeviehot.y = sprite.hot.y;
|
||||||
|
#endif
|
||||||
ROOT = WindowTable[sprite.hot.pScreen->myNum];
|
ROOT = WindowTable[sprite.hot.pScreen->myNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2057,34 +2010,20 @@ CheckMotion(xEvent *xE)
|
||||||
sprite.hot.pScreen = sprite.hotPhys.pScreen;
|
sprite.hot.pScreen = sprite.hotPhys.pScreen;
|
||||||
ROOT = WindowTable[sprite.hot.pScreen->myNum];
|
ROOT = WindowTable[sprite.hot.pScreen->myNum];
|
||||||
}
|
}
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = XE_KBPTR.rootX;
|
sprite.hot.x = XE_KBPTR.rootX;
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = XE_KBPTR.rootY;
|
sprite.hot.y = XE_KBPTR.rootY;
|
||||||
if (sprite.hot.x < sprite.physLimits.x1)
|
if (sprite.hot.x < sprite.physLimits.x1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = sprite.physLimits.x1;
|
sprite.hot.x = sprite.physLimits.x1;
|
||||||
else if (sprite.hot.x >= sprite.physLimits.x2)
|
else if (sprite.hot.x >= sprite.physLimits.x2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.x =
|
|
||||||
#endif
|
|
||||||
sprite.hot.x = sprite.physLimits.x2 - 1;
|
sprite.hot.x = sprite.physLimits.x2 - 1;
|
||||||
if (sprite.hot.y < sprite.physLimits.y1)
|
if (sprite.hot.y < sprite.physLimits.y1)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = sprite.physLimits.y1;
|
sprite.hot.y = sprite.physLimits.y1;
|
||||||
else if (sprite.hot.y >= sprite.physLimits.y2)
|
else if (sprite.hot.y >= sprite.physLimits.y2)
|
||||||
#ifdef XEVIE
|
|
||||||
xeviehot.y =
|
|
||||||
#endif
|
|
||||||
sprite.hot.y = sprite.physLimits.y2 - 1;
|
sprite.hot.y = sprite.physLimits.y2 - 1;
|
||||||
|
#ifdef XEVIE
|
||||||
|
xeviehot.x = sprite.hot.x;
|
||||||
|
xeviehot.y = sprite.hot.y;
|
||||||
|
#endif
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (sprite.hotShape)
|
if (sprite.hotShape)
|
||||||
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
|
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user