summaryrefslogtreecommitdiff
path: root/Xext/xtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r--Xext/xtest.c58
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,