[PATCH] Fix panoramiX request and reply swapping

Peter Harris peter.harris at hummingbird.com
Tue Dec 18 10:51:01 PST 2007


From a4600733ef46585df5481923b8eedffe922c23dc Mon Sep 17 00:00:00 2001
From: Peter Harris <peter.harris at hummingbird.com>
Date: Tue, 18 Dec 2007 13:14:07 -0500
Subject: [PATCH] Fix panoramiX request and reply swapping

---

Resending, this time with the correct subject line.

My previous patch missed replies, and also missed the RandR panoramiX 
emulation layer. This patch fixes those omissions.

I noticed while creating this patch that the reference server does not set 
rep.window anywhere. Should I send another patch to fix that omission (or 
amend this patch)?

 Xext/panoramiX.c   |   10 ++++++----
 randr/rrxinerama.c |   14 ++++++++++----
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 311a8e7..650e34e 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -920,7 +920,7 @@ ProcPanoramiXGetState(ClientPtr client)
     	if (client->swapped) {
 	    swaps (&rep.sequenceNumber, n);
 	    swapl (&rep.length, n);
-	    swaps (&rep.state, n);
+	    swapl (&rep.window, n);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
 	return client->noClientException;
@@ -947,7 +947,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
     	if (client->swapped) {
 	    swaps (&rep.sequenceNumber, n);
 	    swapl (&rep.length, n);
-	    swaps (&rep.ScreenCount, n);
+	    swapl (&rep.window, n);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) 
&rep);
 	return client->noClientException;
@@ -975,8 +975,10 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
     	if (client->swapped) {
 	    swaps (&rep.sequenceNumber, n);
 	    swapl (&rep.length, n);
-	    swaps (&rep.width, n);
-	    swaps (&rep.height, n);
+	    swapl (&rep.width, n);
+	    swapl (&rep.height, n);
+	    swapl (&rep.window, n);
+	    swapl (&rep.screen, n);
 	}	
 	WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) 
&rep);
 	return client->noClientException;
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 896f61f..a9bc212 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -141,7 +141,7 @@ ProcRRXineramaGetState(ClientPtr client)
     if(client->swapped) {
        swaps (&rep.sequenceNumber, n);
        swapl (&rep.length, n);
-       swaps (&rep.state, n);
+       swapl (&rep.window, n);
     }
     WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
     return client->noClientException;
@@ -195,7 +195,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
     if(client->swapped) {
        swaps(&rep.sequenceNumber, n);
        swapl(&rep.length, n);
-       swaps(&rep.ScreenCount, n);
+       swapl(&rep.window, n);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char 
*)&rep);
     return client->noClientException;
@@ -226,8 +226,10 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
     if(client->swapped) {
        swaps(&rep.sequenceNumber, n);
        swapl(&rep.length, n);
-       swaps(&rep.width, n);
-       swaps(&rep.height, n);
+       swapl(&rep.width, n);
+       swapl(&rep.height, n);
+       swapl(&rep.window, n);
+       swapl(&rep.screen, n);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char 
*)&rep);
     return client->noClientException;
@@ -351,6 +353,7 @@ SProcRRXineramaGetState(ClientPtr client)
     register int n;
     swaps (&stuff->length, n);
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+    swapl (&stuff->window, n);
     return ProcRRXineramaGetState(client);
 }
 
@@ -361,6 +364,7 @@ SProcRRXineramaGetScreenCount(ClientPtr client)
     register int n;
     swaps (&stuff->length, n);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+    swapl (&stuff->window, n);
     return ProcRRXineramaGetScreenCount(client);
 }
 
@@ -371,6 +375,8 @@ SProcRRXineramaGetScreenSize(ClientPtr client)
     register int n;
     swaps (&stuff->length, n);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+    swapl (&stuff->window, n);
+    swapl (&stuff->screen, n);
     return ProcRRXineramaGetScreenSize(client);
 }
 
-- 
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