diff -urN xorg-server-X11R7.1-1.1.0/hw/xfree86/common/xf86Config.c xorg-server-X11R7.1-1.1.0-xineramainfo/hw/xfree86/common/xf86Config.c --- xorg-server-X11R7.1-1.1.0/hw/xfree86/common/xf86Config.c 2006-04-07 03:40:52.000000000 +0200 +++ xorg-server-X11R7.1-1.1.0-xineramainfo/hw/xfree86/common/xf86Config.c 2007-02-24 22:59:00.000000000 +0100 @@ -780,6 +780,7 @@ FLAG_ESTIMATE_SIZES_AGGRESSIVELY, FLAG_NOPM, FLAG_XINERAMA, + FLAG_XINERAMAINFO, FLAG_ALLOW_DEACTIVATE_GRABS, FLAG_ALLOW_CLOSEDOWN_GRABS, FLAG_LOG, @@ -844,6 +845,8 @@ {0}, FALSE }, { FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN, {0}, FALSE }, + { FLAG_XINERAMAINFO, "XineramaInfo", OPTV_STRING, + {0}, FALSE }, { FLAG_ALLOW_DEACTIVATE_GRABS,"AllowDeactivateGrabs", OPTV_BOOLEAN, {0}, FALSE }, { FLAG_ALLOW_CLOSEDOWN_GRABS, "AllowClosedownGrabs", OPTV_BOOLEAN, @@ -1130,8 +1133,48 @@ noPanoramiXExtension = !value; from = X_CONFIG; } - if (!noPanoramiXExtension) + if (!noPanoramiXExtension) { + const char *s; xf86Msg(from, "Xinerama: enabled\n"); + if ((s = xf86GetOptValString(FlagOptions, FLAG_XINERAMAINFO))) { + char *b=s; + xf86Msg(X_CONFIG, "XineramaInfo: \"%s\"\n", s); + do { + char *t=0, *p1=0, *p2=0; + t=index(b,'x'); + if(t) { + t++; + p1=index(t,'+'); + if(p1) { + p1++; + p2=index(p1,'+'); + if(p2) { + p2++; + if(XineramaInfoScreensNum<16) { + XineramaInfoScreensGeometry[XineramaInfoScreensNum][0]=atoi(b); + XineramaInfoScreensGeometry[XineramaInfoScreensNum][1]=atoi(t); + XineramaInfoScreensGeometry[XineramaInfoScreensNum][2]=atoi(p1); + XineramaInfoScreensGeometry[XineramaInfoScreensNum][3]=atoi(p2); + XineramaInfoScreensNum++; + }; + }; + }; + }; + b=index(b,','); + if(b) b++; + } while(b); + do { + int i; + for(i=0;isequence; rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; @@ -1106,6 +1113,73 @@ WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); } } +#else + if(XineramaInfoScreensNum!=0) { + xXineramaScreenInfo scratch; + int i; + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.number = XineramaInfoScreensNum; + rep.length = rep.number * sz_XineramaScreenInfo >> 2; + if (client->swapped) { + register int n; + swaps (&rep.sequenceNumber, n); + swapl (&rep.length, n); + swapl (&rep.number, n); + } + WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); + + for(i = 0; i < XineramaInfoScreensNum; i++) { + scratch.x_org = XineramaInfoScreensGeometry[i][2]; + scratch.y_org = XineramaInfoScreensGeometry[i][3]; + scratch.width = XineramaInfoScreensGeometry[i][0]; + scratch.height = XineramaInfoScreensGeometry[i][1]; + + if(client->swapped) { + register int n; + swaps (&scratch.x_org, n); + swaps (&scratch.y_org, n); + swaps (&scratch.width, n); + swaps (&scratch.height, n); + } + WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); + } + } + else { + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; + rep.length = rep.number * sz_XineramaScreenInfo >> 2; + if (client->swapped) { + register int n; + swaps (&rep.sequenceNumber, n); + swapl (&rep.length, n); + swapl (&rep.number, n); + } + WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); + + if(!noPanoramiXExtension) { + xXineramaScreenInfo scratch; + int i; + + for(i = 0; i < PanoramiXNumScreens; i++) { + scratch.x_org = panoramiXdataPtr[i].x; + scratch.y_org = panoramiXdataPtr[i].y; + scratch.width = panoramiXdataPtr[i].width; + scratch.height = panoramiXdataPtr[i].height; + + if(client->swapped) { + register int n; + swaps (&scratch.x_org, n); + swaps (&scratch.y_org, n); + swaps (&scratch.width, n); + swaps (&scratch.height, n); + } + WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); + } + } + }; +#endif return client->noClientException; }