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)
|
||||
{
|
||||
sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
||||
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
||||
NullWindow;
|
||||
|
@ -505,24 +499,12 @@ XineramaCheckVirtualMotion(
|
|||
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
|
||||
|
||||
if (sprite.hot.x < lims.x1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = lims.x1;
|
||||
else if (sprite.hot.x >= lims.x2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = lims.x2 - 1;
|
||||
if (sprite.hot.y < lims.y1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = lims.y1;
|
||||
else if (sprite.hot.y >= lims.y2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = lims.y2 - 1;
|
||||
|
||||
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
|
||||
|
@ -535,6 +517,10 @@ XineramaCheckVirtualMotion(
|
|||
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;
|
||||
XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
|
||||
panoramiXdataPtr[0].y;
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = XE_KBPTR.rootX;
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = XE_KBPTR.rootY;
|
||||
if (sprite.hot.x < sprite.physLimits.x1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = sprite.physLimits.x1;
|
||||
else if (sprite.hot.x >= sprite.physLimits.x2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = sprite.physLimits.x2 - 1;
|
||||
if (sprite.hot.y < sprite.physLimits.y1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = sprite.physLimits.y1;
|
||||
else if (sprite.hot.y >= sprite.physLimits.y2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = sprite.physLimits.y2 - 1;
|
||||
|
||||
if (sprite.hotShape)
|
||||
|
@ -596,6 +564,8 @@ XineramaCheckMotion(xEvent *xE)
|
|||
}
|
||||
|
||||
#ifdef XEVIE
|
||||
xeviehot.x = sprite.hot.x;
|
||||
xeviehot.y = sprite.hot.y;
|
||||
xeviewin =
|
||||
#endif
|
||||
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
|
||||
|
@ -821,13 +791,7 @@ CheckVirtualMotion(
|
|||
if (qe)
|
||||
{
|
||||
sprite.hot.pScreen = qe->pScreen;
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
|
||||
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
|
||||
NullWindow;
|
||||
|
@ -839,31 +803,16 @@ CheckVirtualMotion(
|
|||
if (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;
|
||||
}
|
||||
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
|
||||
if (sprite.hot.x < lims.x1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = lims.x1;
|
||||
else if (sprite.hot.x >= lims.x2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = lims.x2 - 1;
|
||||
if (sprite.hot.y < lims.y1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = lims.y1;
|
||||
else if (sprite.hot.y >= lims.y2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = lims.y2 - 1;
|
||||
#ifdef SHAPE
|
||||
if (wBoundingShape(pWin))
|
||||
|
@ -876,6 +825,10 @@ CheckVirtualMotion(
|
|||
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];
|
||||
}
|
||||
|
||||
|
@ -2057,34 +2010,20 @@ CheckMotion(xEvent *xE)
|
|||
sprite.hot.pScreen = sprite.hotPhys.pScreen;
|
||||
ROOT = WindowTable[sprite.hot.pScreen->myNum];
|
||||
}
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = XE_KBPTR.rootX;
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = XE_KBPTR.rootY;
|
||||
if (sprite.hot.x < sprite.physLimits.x1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = sprite.physLimits.x1;
|
||||
else if (sprite.hot.x >= sprite.physLimits.x2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.x =
|
||||
#endif
|
||||
sprite.hot.x = sprite.physLimits.x2 - 1;
|
||||
if (sprite.hot.y < sprite.physLimits.y1)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = sprite.physLimits.y1;
|
||||
else if (sprite.hot.y >= sprite.physLimits.y2)
|
||||
#ifdef XEVIE
|
||||
xeviehot.y =
|
||||
#endif
|
||||
sprite.hot.y = sprite.physLimits.y2 - 1;
|
||||
#ifdef XEVIE
|
||||
xeviehot.x = sprite.hot.x;
|
||||
xeviehot.y = sprite.hot.y;
|
||||
#endif
|
||||
#ifdef SHAPE
|
||||
if (sprite.hotShape)
|
||||
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
|
||||
|
|
Loading…
Reference in New Issue
Block a user