Xinerama, extensions, and x2x
Rik Faith <[email protected]> Thu, 13 Mar 2003 17:17:48 -0500
| Newsgroups | gmane.comp.video.x.xinerama |
|---|---|
| Message-ID | <[email protected]> |
I recently noticed that several extensions are not "xinerama-aware".
For example, Extended-Visual-Information will report visuals for two
"screens" even when xdpyinfo reports only one screen present (i.e.,
because of Xinerama). I suspect an issue with MIT-SCREEN-SAVER but have
not investigated -- does anyone use an MIT-SCREEN-SAVER client with
Xinerama (beforelight seems to be the only one).
The XTEST extension performs computations relative to the internal
screens, even though a client (e.g., x2x) obtains information about a
single large Xinerama screen. Below is a patch to Xserver/Xext/test.c
that will fix this problem (against the xtest.c that should be in the
XFree86 4.3.0 tree). I have verified this patch does not alter the
results of the X Test Suite when it is configured to run with the
XT_EXTENSIONS=Yes flag. I have also verified that x2x works as expected
with this patch, and not without it.
I used: http://www.netsw.org/x11/extensions/x2x/x2x-1.27.tar.gz
(Note that because of the way the other XTEST code (e.g., IIRC, the
client-side library) is written, I was unable to write a xinerama-aware
client that could do anything to trick XTEST into doing the expected
thing. For simplicity, I suggest fixing it here.)
Thanks for your help, Rik Faith
--- xtest.c 14 Dec 2002 03:09:57 -0000 1.1.1.1
+++ xtest.c 13 Mar 2003 21:05:20 -0000
@@ -59,6 +59,11 @@ static unsigned char XTestReqCode;
extern int DeviceValuator;
#endif /* XINPUT */
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
static void XTestResetProc(
#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
@@ -378,6 +383,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(root, &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 +418,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,
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en