[PATCH 2/2] Fix panoramiX request and reply swapping

Peter Harris peter.harris at hummingbird.com
Thu Dec 20 13:44:40 PST 2007


From 66190149a51cd1925ce88dabe32fdd49c45924c8 Mon Sep 17 00:00:00 2001
From: Peter Harris <peter.harris at hummingbird.com>
Date: Thu, 20 Dec 2007 16:25:54 -0500
Subject: [PATCH] Fix panoramiX request and reply swapping

Fix ProcRRXineramaGetScreenSize to be more like ProcRRXineramaQueryScreens

---

 I have not tested this patch. Please do not apply before testing,
or at least reviewing in detail.

 randr/rrxinerama.c |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 16028fe..2c7e1ed 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -207,7 +207,7 @@ int
 ProcRRXineramaGetScreenSize(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenSizeReq);
-    WindowPtr				pWin, pRoot;
+    WindowPtr				pWin;
     ScreenPtr				pScreen;
     xPanoramiXGetScreenSizeReply	rep;
     register int			n, rc;
@@ -218,13 +218,34 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
 	return rc;
 
     pScreen = pWin->drawable.pScreen;
-    pRoot = WindowTable[pScreen->myNum];
+    if (RRXineramaScreenActive (pScreen))
+    {
+	rrScrPriv(pScreen);
+	if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0)
+	    RRGetInfo (pScreen);
+    }
     
+    if (stuff->screen >= RRXineramaScreenCount (pScreen))
+	return BadMatch;
+
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
-    rep.width  = pRoot->drawable.width;
-    rep.height = pRoot->drawable.height;
+    rep.width = 0;
+    rep.height = 0;
+    {
+	RRCrtcPtr crtc;
+	rrScrPriv(pScreen);
+	crtc = pScrPriv->crtcs[stuff->screen];
+	
+	if (RRXineramaCrtcActive (crtc))
+	{
+	    int width, height;
+	    RRCrtcGetScanoutSize (crtc, &width, &height);
+	    rep.width  = width;
+	    rep.height = height;
+	}
+    }
     rep.window = stuff->window;
     rep.screen = stuff->screen;
     if(client->swapped) {
-- 
1.5.3.7


-- 
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866



More information about the xorg mailing list