diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-21 04:12:07 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-21 04:12:07 +0200 |
commit | 17f3e3bc5157eeb6018ddaa6d862ca94f4b02b2b (patch) | |
tree | 38cc2874f114bc6a564c9aa518196da93b1f67dc /nx-X11/programs/Xserver/dix/events.c | |
parent | 9013a24da1830b445c03ba273e80774fd1d68fd7 (diff) | |
parent | 4c8fc6be8f530d3bc84d1097bd2cb6a4af6c77fc (diff) | |
download | nx-libs-17f3e3bc5157eeb6018ddaa6d862ca94f4b02b2b.tar.gz nx-libs-17f3e3bc5157eeb6018ddaa6d862ca94f4b02b2b.tar.bz2 nx-libs-17f3e3bc5157eeb6018ddaa6d862ca94f4b02b2b.zip |
Merge branch 'sunweaver-pr/xrandr-extension-upgrade-1.5' into 3.6.x
Attributes GH PR #137: https://github.com/ArcticaProject/nx-libs/pull/137
Reviewed by: Ulrich Sibiller <uli42@gmx.de> -- Mon, 20 Jun 2016 12:40:52 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/dix/events.c')
-rw-r--r-- | nx-X11/programs/Xserver/dix/events.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 9005cd226..0fda4b294 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,13 +2035,12 @@ 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. */ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) { - ScreenPtr pScreen = win->drawable.pScreen; GrabPtr grab; if (noPanoramiXExtension) return; @@ -2067,7 +2067,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 +2144,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 +2157,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 @@ -2169,7 +2169,6 @@ XineramaPointInWindowIsVisible( int y ) { - ScreenPtr pScreen = pWin->drawable.pScreen; BoxRec box; int i, xoff, yoff; @@ -2185,7 +2184,6 @@ XineramaPointInWindowIsVisible( for(i = 1; i < PanoramiXNumScreens; i++) { pWin = sprite.windows[i]; - pScreen = pWin->drawable.pScreen; x = xoff - panoramiXdataPtr[i].x; y = yoff - panoramiXdataPtr[i].y; @@ -2231,7 +2229,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 +2245,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 +2820,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 +3354,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 +3373,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 +3391,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); |