aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/dix/events.c')
-rw-r--r--nx-X11/programs/Xserver/dix/events.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c
index 9005cd226..8f943887a 100644
--- a/nx-X11/programs/Xserver/dix/events.c
+++ b/nx-X11/programs/Xserver/dix/events.c
@@ -413,9 +413,10 @@ XineramaCheckPhysLimits(
static Bool
XineramaSetWindowPntrs(WindowPtr pWin)
{
- if(pWin == WindowTable[0]) {
- memcpy(sprite.windows, WindowTable,
- PanoramiXNumScreens*sizeof(WindowPtr));
+ if(pWin == screenInfo.screens[0]->root) {
+ int i;
+ for (i = 0; i < PanoramiXNumScreens; i++)
+ sprite.windows[i] = screenInfo.screens[i]->root;
} else {
PanoramiXRes *win;
int i;
@@ -601,7 +602,7 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
sprite.hotShape = NullRegion;
sprite.confined = FALSE;
- sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin;
+ sprite.confineWin = (pWin == screenInfo.screens[0]->root) ? NullWindow : pWin;
XineramaCheckPhysLimits(sprite.current, generateEvents);
}
@@ -797,7 +798,7 @@ CheckVirtualMotion(
qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
}
}
- ROOT = WindowTable[sprite.hot.pScreen->myNum];
+ ROOT = sprite.hot.pScreen->root;
}
static void
@@ -997,7 +998,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
*/
if (xE->u.u.type == MotionNotify)
XE_KBPTR.root =
- WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
+ sprite.hotPhys.pScreen->root->drawable.id;
eventinfo.events = xE;
eventinfo.count = count;
CallCallbacks(&DeviceEventCallback, (void *)&eventinfo);
@@ -1160,7 +1161,7 @@ playmore:
ConfineCursorToWindow(grab->confineTo, TRUE, TRUE);
}
else
- ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum],
+ ConfineCursorToWindow(sprite.hotPhys.pScreen->root,
TRUE, FALSE);
PostNewCursor();
}
@@ -1178,7 +1179,7 @@ ScreenRestructured (ScreenPtr pScreen)
ConfineCursorToWindow(grab->confineTo, TRUE, TRUE);
}
else
- ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum],
+ ConfineCursorToWindow(sprite.hotPhys.pScreen->root,
TRUE, FALSE);
}
#endif
@@ -1976,7 +1977,7 @@ CheckMotion(xEvent *xE)
if (sprite.hot.pScreen != sprite.hotPhys.pScreen)
{
sprite.hot.pScreen = sprite.hotPhys.pScreen;
- ROOT = WindowTable[sprite.hot.pScreen->myNum];
+ ROOT = sprite.hot.pScreen->root;
}
sprite.hot.x = XE_KBPTR.rootX;
sprite.hot.y = XE_KBPTR.rootY;
@@ -2034,7 +2035,7 @@ WindowsRestructured()
#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]->root) 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. */
@@ -2067,7 +2068,7 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
sprite.hotPhys.x = sprite.hotPhys.y = 0;
ConfineCursorToWindow(grab->confineTo, TRUE, TRUE);
} else
- ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum],
+ ConfineCursorToWindow(sprite.hotPhys.pScreen->root,
TRUE, FALSE);
}
#endif
@@ -2144,7 +2145,7 @@ NewCurrentScreen(ScreenPtr newScreen, int x, int y)
if(sprite.confineWin)
XineramaConfineCursorToWindow(sprite.confineWin, TRUE);
else
- XineramaConfineCursorToWindow(WindowTable[0], TRUE);
+ XineramaConfineCursorToWindow(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)
@@ -2157,7 +2158,7 @@ NewCurrentScreen(ScreenPtr newScreen, int x, int y)
} else
#endif
if (newScreen != sprite.hotPhys.pScreen)
- ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE);
+ ConfineCursorToWindow(newScreen->root, TRUE, FALSE);
}
#ifdef PANORAMIX
@@ -2231,7 +2232,7 @@ XineramaWarpPointer(ClientPtr client)
winX = source->drawable.x;
winY = source->drawable.y;
- if(source == WindowTable[0]) {
+ if(source == screenInfo.screens[0]->root) {
winX -= panoramiXdataPtr[0].x;
winY -= panoramiXdataPtr[0].y;
}
@@ -2247,7 +2248,7 @@ XineramaWarpPointer(ClientPtr client)
if (dest) {
x = dest->drawable.x;
y = dest->drawable.y;
- if(dest == WindowTable[0]) {
+ if(dest == screenInfo.screens[0]->root) {
x -= panoramiXdataPtr[0].x;
y -= panoramiXdataPtr[0].y;
}
@@ -2822,7 +2823,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
/* see comment in EnqueueEvents regarding the next three lines */
if (xE->u.u.type == MotionNotify)
XE_KBPTR.root =
- WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
+ sprite.hotPhys.pScreen->root->drawable.id;
eventinfo.events = xE;
eventinfo.count = count;
CallCallbacks(&DeviceEventCallback, (void *)&eventinfo);
@@ -3356,11 +3357,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode)
/* Notify all the roots */
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
+ FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[0]->root);
else
#endif
for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
+ FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[i]->root);
}
else
{
@@ -3375,11 +3376,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode)
/* Notify all the roots */
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusIn, mode, in, WindowTable[0]);
+ FocusEvent(dev, FocusIn, mode, in, screenInfo.screens[0]->root);
else
#endif
for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusIn, mode, in, WindowTable[i]);
+ FocusEvent(dev, FocusIn, mode, in, screenInfo.screens[i]->root);
if (toWin == PointerRootWin)
(void)FocusInEvents(dev, ROOT, sprite.win, NullWindow, mode,
NotifyPointer, TRUE);
@@ -3393,11 +3394,11 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode)
TRUE);
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
+ FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[0]->root);
else
#endif
for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
+ FocusEvent(dev, FocusOut, mode, out, screenInfo.screens[i]->root);
if (toWin->parent != NullWindow)
(void)FocusInEvents(dev, ROOT, toWin, toWin, mode,
NotifyNonlinearVirtual, TRUE);