diff options
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r-- | xorg-server/dix/events.c | 290 |
1 files changed, 139 insertions, 151 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index d156cf3ed..91966c4a8 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -331,7 +331,7 @@ IsKeyboardDevice(DeviceIntPtr dev) Bool
IsMaster(DeviceIntPtr dev)
{
- return (dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD);
+ return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
}
static WindowPtr XYToWindow(
@@ -486,6 +486,13 @@ SyntheticMotion(DeviceIntPtr dev, int x, int y) { static void PostNewCursor(DeviceIntPtr pDev);
static Bool
+pointOnScreen(ScreenPtr pScreen, int x, int y)
+{
+ return x >= pScreen->x && x < pScreen->x + pScreen->width &&
+ y >= pScreen->y && y < pScreen->y + pScreen->height;
+}
+
+static Bool
XineramaSetCursorPosition(
DeviceIntPtr pDev,
int x,
@@ -493,7 +500,6 @@ XineramaSetCursorPosition( Bool generateEvent
){
ScreenPtr pScreen;
- BoxRec box;
int i;
SpritePtr pSprite = pDev->spriteInfo->sprite;
@@ -502,17 +508,16 @@ XineramaSetCursorPosition( that screen are. */
pScreen = pSprite->screen;
- x += panoramiXdataPtr[0].x;
- y += panoramiXdataPtr[0].y;
+ x += screenInfo.screens[0]->x;
+ y += screenInfo.screens[0]->y;
- if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- x, y, &box))
+ if(!pointOnScreen(pScreen, x, y))
{
FOR_NSCREENS(i)
{
if(i == pScreen->myNum)
continue;
- if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
+ if(pointOnScreen(screenInfo.screens[i], x, y))
{
pScreen = screenInfo.screens[i];
break;
@@ -521,10 +526,10 @@ XineramaSetCursorPosition( }
pSprite->screen = pScreen;
- pSprite->hotPhys.x = x - panoramiXdataPtr[0].x;
- pSprite->hotPhys.y = y - panoramiXdataPtr[0].y;
- x -= panoramiXdataPtr[pScreen->myNum].x;
- y -= panoramiXdataPtr[pScreen->myNum].y;
+ pSprite->hotPhys.x = x - screenInfo.screens[0]->x;
+ pSprite->hotPhys.y = y - screenInfo.screens[0]->y;
+ x -= pScreen->x;
+ y -= pScreen->y;
return (*pScreen->SetCursorPosition)(pDev, pScreen, x, y, generateEvent);
}
@@ -542,10 +547,10 @@ XineramaConstrainCursor(DeviceIntPtr pDev) /* Translate the constraining box to the screen
the sprite is actually on */
- newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
- newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
- newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
- newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
+ newBox.x1 += screenInfo.screens[0]->x - pScreen->x;
+ newBox.x2 += screenInfo.screens[0]->x - pScreen->x;
+ newBox.y1 += screenInfo.screens[0]->y - pScreen->y;
+ newBox.y2 += screenInfo.screens[0]->y - pScreen->y;
(* pScreen->ConstrainCursor)(pDev, pScreen, &newBox);
}
@@ -556,9 +561,10 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) {
SpritePtr pSprite = pDev->spriteInfo->sprite;
- if(pWin == WindowTable[0]) {
- memcpy(pSprite->windows, WindowTable,
- PanoramiXNumScreens*sizeof(WindowPtr));
+ if(pWin == screenInfo.screens[0]->root) {
+ int i;
+ for (i = 0; i < PanoramiXNumScreens; i++)
+ pSprite->windows[i] = screenInfo.screens[i]->root;
} else {
PanoramiXRes *win;
int rc, i;
@@ -592,34 +598,34 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, i = PanoramiXNumScreens - 1;
- REGION_COPY(pSprite->screen, &pSprite->Reg1,
+ RegionCopy(&pSprite->Reg1,
&pSprite->windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
+ off_x = screenInfo.screens[i]->x;
+ off_y = screenInfo.screens[i]->y;
while(i--) {
- x = off_x - panoramiXdataPtr[i].x;
- y = off_y - panoramiXdataPtr[i].y;
+ x = off_x - screenInfo.screens[i]->x;
+ y = off_y - screenInfo.screens[i]->y;
if(x || y)
- REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, x, y);
+ RegionTranslate(&pSprite->Reg1, x, y);
- REGION_UNION(pSprite->screen, &pSprite->Reg1, &pSprite->Reg1,
+ RegionUnion(&pSprite->Reg1, &pSprite->Reg1,
&pSprite->windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
+ off_x = screenInfo.screens[i]->x;
+ off_y = screenInfo.screens[i]->y;
}
- pSprite->hotLimits = *REGION_EXTENTS(pSprite->screen, &pSprite->Reg1);
+ pSprite->hotLimits = *RegionExtents(&pSprite->Reg1);
- if(REGION_NUM_RECTS(&pSprite->Reg1) > 1)
+ if(RegionNumRects(&pSprite->Reg1) > 1)
pSprite->hotShape = &pSprite->Reg1;
else
pSprite->hotShape = NullRegion;
pSprite->confined = FALSE;
- pSprite->confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin;
+ pSprite->confineWin = (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin;
CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL);
}
@@ -665,9 +671,9 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) SpritePtr pSprite;
pSprite = pDev->spriteInfo->sprite;
- if (POINT_IN_REGION(pSprite->hot.pScreen, shape, x, y, &box))
+ if (RegionContainsPoint(shape, x, y, &box))
return;
- box = *REGION_EXTENTS(pSprite->hot.pScreen, shape);
+ box = *RegionExtents(shape);
/* this is rather crude */
do {
x += incx;
@@ -689,7 +695,7 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) else if (y < box.y1)
return; /* should never get here! */
}
- } while (!POINT_IN_REGION(pSprite->hot.pScreen, shape, x, y, &box));
+ } while (!RegionContainsPoint(shape, x, y, &box));
*px = x;
*py = y;
}
@@ -814,23 +820,23 @@ CheckVirtualMotion( i = PanoramiXNumScreens - 1;
- REGION_COPY(pSprite->screen, &pSprite->Reg2,
+ RegionCopy(&pSprite->Reg2,
&pSprite->windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
+ off_x = screenInfo.screens[i]->x;
+ off_y = screenInfo.screens[i]->y;
while(i--) {
- x = off_x - panoramiXdataPtr[i].x;
- y = off_y - panoramiXdataPtr[i].y;
+ x = off_x - screenInfo.screens[i]->x;
+ y = off_y - screenInfo.screens[i]->y;
if(x || y)
- REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, x, y);
+ RegionTranslate(&pSprite->Reg2, x, y);
- REGION_UNION(pSprite->screen, &pSprite->Reg2, &pSprite->Reg2,
+ RegionUnion(&pSprite->Reg2, &pSprite->Reg2,
&pSprite->windows[i]->borderSize);
- off_x = panoramiXdataPtr[i].x;
- off_y = panoramiXdataPtr[i].y;
+ off_x = screenInfo.screens[i]->x;
+ off_y = screenInfo.screens[i]->y;
}
} else
#endif
@@ -842,7 +848,7 @@ CheckVirtualMotion( }
}
- lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
+ lims = *RegionExtents(&pWin->borderSize);
if (pSprite->hot.x < lims.x1)
pSprite->hot.x = lims.x1;
else if (pSprite->hot.x >= lims.x2)
@@ -855,7 +861,7 @@ CheckVirtualMotion( #ifdef PANORAMIX
if (!noPanoramiXExtension)
{
- if (REGION_NUM_RECTS(&pSprite->Reg2) > 1)
+ if (RegionNumRects(&pSprite->Reg2) > 1)
reg = &pSprite->Reg2;
} else
@@ -878,13 +884,12 @@ CheckVirtualMotion( #ifdef PANORAMIX
if (noPanoramiXExtension) /* No typo. Only set the root win if disabled */
#endif
- RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
+ RootWindow(pDev) = pSprite->hot.pScreen->root;
}
static void
ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
{
- ScreenPtr pScreen = pWin->drawable.pScreen;
SpritePtr pSprite = pDev->spriteInfo->sprite;
if (syncEvents.playingEvents)
@@ -900,11 +905,11 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bo return;
}
#endif
- pSprite->hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
+ pSprite->hotLimits = *RegionExtents(&pWin->borderSize);
pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
: NullRegion;
CheckPhysLimits(pDev, pSprite->current, generateEvents,
- confineToScreen, pScreen);
+ confineToScreen, pWin->drawable.pScreen);
}
}
@@ -1126,7 +1131,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) * updated yet.
*/
if (ev->any.type == ET_Motion)
- ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+ ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id;
eventinfo.event = ev;
eventinfo.device = device;
@@ -1137,10 +1142,8 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) {
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
- event->root_x += panoramiXdataPtr[pSprite->screen->myNum].x -
- panoramiXdataPtr[0].x;
- event->root_y += panoramiXdataPtr[pSprite->screen->myNum].y -
- panoramiXdataPtr[0].y;
+ event->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+ event->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
}
#endif
pSprite->hotPhys.x = event->root_x;
@@ -1220,10 +1223,10 @@ PlayReleasedEvents(void) case ET_KeyRelease:
case ET_ProximityIn:
case ET_ProximityOut:
- ev->root_x += panoramiXdataPtr[0].x -
- panoramiXdataPtr[pDev->spriteInfo->sprite->screen->myNum].x;
- ev->root_y += panoramiXdataPtr[0].y -
- panoramiXdataPtr[pDev->spriteInfo->sprite->screen->myNum].y;
+ ev->root_x += screenInfo.screens[0]->x -
+ pDev->spriteInfo->sprite->screen->x;
+ ev->root_y += screenInfo.screens[0]->y -
+ pDev->spriteInfo->sprite->screen->y;
break;
default:
break;
@@ -1342,7 +1345,7 @@ playmore: }
else
ConfineCursorToWindow(dev,
- WindowTable[dev->spriteInfo->sprite->hotPhys.pScreen->myNum],
+ dev->spriteInfo->sprite->hotPhys.pScreen->root,
TRUE, FALSE);
PostNewCursor(dev);
}
@@ -1372,7 +1375,7 @@ ScreenRestructured (ScreenPtr pScreen) }
else
ConfineCursorToWindow(pDev,
- WindowTable[pDev->spriteInfo->sprite->hotPhys.pScreen->myNum],
+ pDev->spriteInfo->sprite->hotPhys.pScreen->root,
TRUE, FALSE);
}
}
@@ -2551,7 +2554,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) {
BoxRec box;
- if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box))
+ if(RegionContainsPoint(&pWin->borderSize, x, y, &box))
return TRUE;
#ifdef PANORAMIX
@@ -2561,11 +2564,10 @@ PointInBorderSize(WindowPtr pWin, int x, int y) int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
- if(POINT_IN_REGION(pSprite->screen,
- &pSprite->windows[i]->borderSize,
- x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
- y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
- &box))
+ if(RegionContainsPoint(&pSprite->windows[i]->borderSize,
+ x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
+ y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
+ &box))
return TRUE;
}
}
@@ -2609,10 +2611,9 @@ XYToWindow(DeviceIntPtr pDev, int x, int y) */
&& (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
&& (!wInputShape(pWin) ||
- POINT_IN_REGION(pWin->drawable.pScreen,
- wInputShape(pWin),
- x - pWin->drawable.x,
- y - pWin->drawable.y, &box))
+ RegionContainsPoint(wInputShape(pWin),
+ x - pWin->drawable.x,
+ y - pWin->drawable.y, &box))
#ifdef ROOTLESS
/* In rootless mode windows may be offscreen, even when
* they're in X's stack. (E.g. if the native window system
@@ -2762,17 +2763,15 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) /* Motion events entering DIX get translated to Screen 0
coordinates. Replayed events have already been
translated since they've entered DIX before */
- ev->root_x += panoramiXdataPtr[pSprite->screen->myNum].x -
- panoramiXdataPtr[0].x;
- ev->root_y += panoramiXdataPtr[pSprite->screen->myNum].y -
- panoramiXdataPtr[0].y;
+ ev->root_x += pSprite->screen->x - screenInfo.screens[0]->x;
+ ev->root_y += pSprite->screen->y - screenInfo.screens[0]->y;
} else
#endif
{
if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen)
{
pSprite->hot.pScreen = pSprite->hotPhys.pScreen;
- RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
+ RootWindow(pDev) = pSprite->hot.pScreen->root;
}
}
@@ -2855,7 +2854,7 @@ WindowsRestructured(void) #ifdef PANORAMIX
/* This was added to support reconfiguration under Xdmx. The problem is
- * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin
+ * that if the 0th screen (i.e., screenInfo.screens[0]) is moved to an origin
* other than 0,0, the information in the private sprite structure must
* be updated accordingly, or XYToWindow (and other routines) will not
* compute correctly. */
@@ -2884,10 +2883,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) pSprite->hotLimits.x2 -= xoff;
pSprite->hotLimits.y2 -= yoff;
- if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg1))
- REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, xoff, yoff);
- if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg2))
- REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, xoff, yoff);
+ if (RegionNotEmpty(&pSprite->Reg1))
+ RegionTranslate(&pSprite->Reg1, xoff, yoff);
+ if (RegionNotEmpty(&pSprite->Reg2))
+ RegionTranslate(&pSprite->Reg2, xoff, yoff);
/* FIXME: if we call ConfineCursorToWindow, must we do anything else? */
if ((grab = pDev->deviceGrab.grab) && grab->confineTo) {
@@ -2898,7 +2897,7 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) } else
ConfineCursorToWindow(
pDev,
- WindowTable[pSprite->hotPhys.pScreen->myNum],
+ pSprite->hotPhys.pScreen->root,
TRUE, FALSE);
}
@@ -3013,17 +3012,17 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) }
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
- pSprite->hotLimits.x1 = -panoramiXdataPtr[0].x;
- pSprite->hotLimits.y1 = -panoramiXdataPtr[0].y;
- pSprite->hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x;
- pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
+ pSprite->hotLimits.x1 = -screenInfo.screens[0]->x;
+ pSprite->hotLimits.y1 = -screenInfo.screens[0]->y;
+ pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x;
+ pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y;
pSprite->physLimits = pSprite->hotLimits;
pSprite->confineWin = NullWindow;
pSprite->hotShape = NullRegion;
pSprite->screen = pScreen;
/* gotta UNINIT these someplace */
- REGION_NULL(pScreen, &pSprite->Reg1);
- REGION_NULL(pScreen, &pSprite->Reg2);
+ RegionNull(&pSprite->Reg1);
+ RegionNull(&pSprite->Reg2);
}
#endif
}
@@ -3057,7 +3056,7 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) pSprite = pDev->spriteInfo->sprite;
- win = WindowTable[pScreen->myNum];
+ win = pScreen->root;
pSprite->hotPhys.pScreen = pScreen;
pSprite->hot = pSprite->hotPhys;
@@ -3083,10 +3082,10 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) #ifdef PANORAMIX
if(!noPanoramiXExtension) {
- pSprite->hotLimits.x1 = -panoramiXdataPtr[0].x;
- pSprite->hotLimits.y1 = -panoramiXdataPtr[0].y;
- pSprite->hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x;
- pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
+ pSprite->hotLimits.x1 = -screenInfo.screens[0]->x;
+ pSprite->hotLimits.y1 = -screenInfo.screens[0]->y;
+ pSprite->hotLimits.x2 = PanoramiXPixWidth - screenInfo.screens[0]->x;
+ pSprite->hotLimits.y2 = PanoramiXPixHeight - screenInfo.screens[0]->y;
pSprite->physLimits = pSprite->hotLimits;
pSprite->screen = pScreen;
}
@@ -3119,10 +3118,8 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) pSprite->hotPhys.y = y;
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
- pSprite->hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
- panoramiXdataPtr[0].x;
- pSprite->hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
- panoramiXdataPtr[0].y;
+ pSprite->hotPhys.x += newScreen->x - screenInfo.screens[0]->x;
+ pSprite->hotPhys.y += newScreen->y - screenInfo.screens[0]->y;
if (newScreen != pSprite->screen) {
pSprite->screen = newScreen;
/* Make sure we tell the DDX to update its copy of the screen */
@@ -3130,23 +3127,22 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) XineramaConfineCursorToWindow(pDev,
pSprite->confineWin, TRUE);
else
- XineramaConfineCursorToWindow(pDev, WindowTable[0], TRUE);
+ XineramaConfineCursorToWindow(pDev, screenInfo.screens[0]->root, TRUE);
/* if the pointer wasn't confined, the DDX won't get
told of the pointer warp so we reposition it here */
if(!syncEvents.playingEvents)
(*pSprite->screen->SetCursorPosition)(
pDev,
pSprite->screen,
- pSprite->hotPhys.x + panoramiXdataPtr[0].x -
- panoramiXdataPtr[pSprite->screen->myNum].x,
- pSprite->hotPhys.y + panoramiXdataPtr[0].y -
- panoramiXdataPtr[pSprite->screen->myNum].y, FALSE);
+ pSprite->hotPhys.x + screenInfo.screens[0]->x -
+ pSprite->screen->x,
+ pSprite->hotPhys.y + screenInfo.screens[0]->y -
+ pSprite->screen->y, FALSE);
}
} else
#endif
- if (newScreen != pSprite->hotPhys.pScreen && WindowTable[newScreen->myNum])
- ConfineCursorToWindow(pDev, WindowTable[newScreen->myNum],
- TRUE, FALSE);
+ if (newScreen != pSprite->hotPhys.pScreen)
+ ConfineCursorToWindow(pDev, newScreen->root, TRUE, FALSE);
}
#ifdef PANORAMIX
@@ -3158,32 +3154,29 @@ XineramaPointInWindowIsVisible( int y
)
{
- ScreenPtr pScreen = pWin->drawable.pScreen;
BoxRec box;
int i, xoff, yoff;
if (!pWin->realized) return FALSE;
- if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box))
+ if (RegionContainsPoint(&pWin->borderClip, x, y, &box))
return TRUE;
if(!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE;
- xoff = x + panoramiXdataPtr[0].x;
- yoff = y + panoramiXdataPtr[0].y;
+ xoff = x + screenInfo.screens[0]->x;
+ yoff = y + screenInfo.screens[0]->y;
for(i = 1; i < PanoramiXNumScreens; i++) {
pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
- pScreen = pWin->drawable.pScreen;
- x = xoff - panoramiXdataPtr[i].x;
- y = yoff - panoramiXdataPtr[i].y;
+ x = xoff - screenInfo.screens[i]->x;
+ y = yoff - screenInfo.screens[i]->y;
- if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)
+ if(RegionContainsPoint(&pWin->borderClip, x, y, &box)
&& (!wInputShape(pWin) ||
- POINT_IN_REGION(pWin->drawable.pScreen,
- wInputShape(pWin),
- x - pWin->drawable.x,
- y - pWin->drawable.y, &box)))
+ RegionContainsPoint(wInputShape(pWin),
+ x - pWin->drawable.x,
+ y - pWin->drawable.y, &box)))
return TRUE;
}
@@ -3221,9 +3214,9 @@ XineramaWarpPointer(ClientPtr client) winX = source->drawable.x;
winY = source->drawable.y;
- if(source == WindowTable[0]) {
- winX -= panoramiXdataPtr[0].x;
- winY -= panoramiXdataPtr[0].y;
+ if(source == screenInfo.screens[0]->root) {
+ winX -= screenInfo.screens[0]->x;
+ winY -= screenInfo.screens[0]->y;
}
if (x < winX + stuff->srcX ||
y < winY + stuff->srcY ||
@@ -3237,9 +3230,9 @@ XineramaWarpPointer(ClientPtr client) if (dest) {
x = dest->drawable.x;
y = dest->drawable.y;
- if(dest == WindowTable[0]) {
- x -= panoramiXdataPtr[0].x;
- y -= panoramiXdataPtr[0].y;
+ if(dest == screenInfo.screens[0]->root) {
+ x -= screenInfo.screens[0]->x;
+ y -= screenInfo.screens[0]->y;
}
}
@@ -3374,7 +3367,7 @@ ProcWarpPointer(ClientPtr client) static Bool
BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
{
- if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->hotPhys.pScreen, &pWin->borderSize))
+ if(RegionNotEmpty(&pWin->borderSize))
return TRUE;
#ifdef PANORAMIX
@@ -3382,8 +3375,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
- if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->screen,
- &pDev->spriteInfo->sprite->windows[i]->borderSize))
+ if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize))
return TRUE;
}
}
@@ -3807,10 +3799,8 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) }
unwind:
- if (xE)
- free(xE);
- if (xi2)
- free(xi2);
+ free(xE);
+ free(xi2);
return;
}
@@ -3990,10 +3980,8 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, }
}
- if (xi)
- free(xi);
- if (xi2)
- free(xi2);
+ free(xi);
+ free(xi2);
}
/* This function is used to set the key pressed or key released state -
@@ -4101,7 +4089,7 @@ OtherClientGone(pointer value, XID id) }
free(other);
RecalculateDeliverableEvents(pWin);
- return(Success);
+ return Success;
}
prev = other;
}
@@ -4324,7 +4312,7 @@ CoreEnterLeaveEvent( xKeymapEvent ke;
ClientPtr client = grab ? rClient(grab) : wClient(pWin);
if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess))
- bzero((char *)&ke.map[0], 31);
+ memset((char *)&ke.map[0], 0, 31);
else
memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31);
@@ -4434,7 +4422,7 @@ CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) xKeymapEvent ke;
ClientPtr client = wClient(pWin);
if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess))
- bzero((char *)&ke.map[0], 31);
+ memset((char *)&ke.map[0], 0, 31);
else
memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31);
@@ -4506,7 +4494,7 @@ SetInputFocus( /* It is a match error to try to set the input focus to an
unviewable window. */
if(!focusWin->realized)
- return(BadMatch);
+ return BadMatch;
}
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess);
if (rc != Success)
@@ -5003,11 +4991,11 @@ ProcQueryPointer(ClientPtr client) #ifdef PANORAMIX
if(!noPanoramiXExtension) {
- rep.rootX += panoramiXdataPtr[0].x;
- rep.rootY += panoramiXdataPtr[0].y;
+ rep.rootX += screenInfo.screens[0]->x;
+ rep.rootY += screenInfo.screens[0]->y;
if(stuff->id == rep.root) {
- rep.winX += panoramiXdataPtr[0].x;
- rep.winY += panoramiXdataPtr[0].y;
+ rep.winX += screenInfo.screens[0]->x;
+ rep.winY += screenInfo.screens[0]->y;
}
}
#endif
@@ -5023,7 +5011,7 @@ ProcQueryPointer(ClientPtr client) WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
- return(Success);
+ return Success;
}
/**
@@ -5227,8 +5215,8 @@ ProcUngrabKey(ClientPtr client) tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab))
- return(BadAlloc);
- return(Success);
+ return BadAlloc;
+ return Success;
}
/**
@@ -5422,8 +5410,8 @@ ProcUngrabButton(ClientPtr client) tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab))
- return(BadAlloc);
- return(Success);
+ return BadAlloc;
+ return Success;
}
/**
@@ -5637,7 +5625,7 @@ ProcRecolorCursor(ClientPtr client) ( *pscr->RecolorCursor)(PickPointer(client), pscr, pCursor,
(pCursor == pSprite->current) && displayed);
}
- return (Success);
+ return Success;
}
/**
@@ -5676,7 +5664,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) #ifdef PANORAMIX
if(!noPanoramiXExtension &&
- (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y))
+ (screenInfo.screens[0]->x || screenInfo.screens[0]->y))
{
switch(events->u.u.type) {
case MotionNotify:
@@ -5693,13 +5681,13 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) */
count = 1; /* should always be 1 */
memcpy(&eventCopy, events, sizeof(xEvent));
- eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x;
- eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y;
+ eventCopy.u.keyButtonPointer.rootX += screenInfo.screens[0]->x;
+ eventCopy.u.keyButtonPointer.rootY += screenInfo.screens[0]->y;
if(eventCopy.u.keyButtonPointer.event ==
eventCopy.u.keyButtonPointer.root)
{
- eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x;
- eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y;
+ eventCopy.u.keyButtonPointer.eventX += screenInfo.screens[0]->x;
+ eventCopy.u.keyButtonPointer.eventY += screenInfo.screens[0]->y;
}
events = &eventCopy;
break;
|