diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:01 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:01 +0000 |
commit | adc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 (patch) | |
tree | 23eb7becc5360b2cbe16aa8d45529880067f3989 /Xext/xtest.c | |
parent | 90f1536dd315cd265bfc7ef35058761a65a01734 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r-- | Xext/xtest.c | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c index 47e7418d8..89bcae3a4 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.7 2001/12/14 19:58:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.11 2003/11/17 22:20:27 dawes Exp $ */ #include "X.h" #define NEED_EVENTS @@ -53,22 +53,27 @@ from The Open Group. #include "xf86_ansic.h" #endif +#include "modinit.h" + +#if 0 static unsigned char XTestReqCode; +#endif #ifdef XINPUT extern int DeviceValuator; #endif /* XINPUT */ +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" +#endif + static void XTestResetProc( -#if NeedFunctionPrototypes ExtensionEntry * /* extEntry */ -#endif ); static int XTestSwapFakeInput( -#if NeedFunctionPrototypes ClientPtr /* client */, xReq * /* req */ -#endif ); static DISPATCH_PROC(ProcXTestCompareCursor); @@ -83,14 +88,20 @@ static DISPATCH_PROC(SProcXTestGetVersion); static DISPATCH_PROC(SProcXTestGrabControl); void -XTestExtensionInit() +XTestExtensionInit(INITARGS) { +#if 0 ExtensionEntry *extEntry; if ((extEntry = AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, XTestResetProc, StandardMinorOpcode)) != 0) XTestReqCode = (unsigned char)extEntry->base; +#else + (void) AddExtension(XTestExtensionName, 0, 0, + ProcXTestDispatch, SProcXTestDispatch, + XTestResetProc, StandardMinorOpcode); +#endif } /*ARGSUSED*/ @@ -378,6 +389,33 @@ ProcXTestFakeInput(client) client->errorValue = ev->u.u.detail; return BadValue; } + +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + ScreenPtr pScreen = root->drawable.pScreen; + BoxRec box; + int i; + int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x; + int y = ev->u.keyButtonPointer.rootY + panoramiXdataPtr[0].y; + if (!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], + x, y, &box)) { + FOR_NSCREENS(i) { + if (i == pScreen->myNum) continue; + if (POINT_IN_REGION(pScreen, + &XineramaScreenRegions[i], + x, y, &box)) { + root = WindowTable[i]; + x -= panoramiXdataPtr[i].x; + y -= panoramiXdataPtr[i].y; + ev->u.keyButtonPointer.rootX = x; + ev->u.keyButtonPointer.rootY = y; + break; + } + } + } + } +#endif + if (ev->u.keyButtonPointer.rootX < 0) ev->u.keyButtonPointer.rootX = 0; else if (ev->u.keyButtonPointer.rootX >= root->drawable.width) @@ -386,7 +424,15 @@ ProcXTestFakeInput(client) ev->u.keyButtonPointer.rootY = 0; else if (ev->u.keyButtonPointer.rootY >= root->drawable.height) ev->u.keyButtonPointer.rootY = root->drawable.height - 1; + +#ifdef PANORAMIX + if ((!noPanoramiXExtension + && root->drawable.pScreen->myNum != XineramaGetCursorScreen()) + || (noPanoramiXExtension && root != GetCurrentRootWindow())) + +#else if (root != GetCurrentRootWindow()) +#endif { NewCurrentScreen(root->drawable.pScreen, ev->u.keyButtonPointer.rootX, |