aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrxinerama.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/rrxinerama.c')
-rw-r--r--xorg-server/randr/rrxinerama.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/xorg-server/randr/rrxinerama.c b/xorg-server/randr/rrxinerama.c
index aa8a61eee..63e2a318b 100644
--- a/xorg-server/randr/rrxinerama.c
+++ b/xorg-server/randr/rrxinerama.c
@@ -93,8 +93,8 @@ ProcRRXineramaQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
rep.type = X_Reply;
- rep.length = 0;
rep.sequenceNumber = client->sequence;
+ rep.length = 0;
rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
if (client->swapped) {
@@ -103,7 +103,7 @@ ProcRRXineramaQueryVersion(ClientPtr client)
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
return Success;
}
@@ -130,17 +130,19 @@ ProcRRXineramaGetState(ClientPtr client)
active = TRUE;
}
+
rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
rep.state = active;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
rep.window = stuff->window;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
return Success;
}
@@ -184,17 +186,19 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
if (rc != Success)
return rc;
+
rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
rep.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen);
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
rep.window = stuff->window;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
return Success;
}
@@ -215,13 +219,15 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
pScreen = pWin->drawable.pScreen;
pRoot = pScreen->root;
+
rep.type = X_Reply;
- rep.length = 0;
rep.sequenceNumber = client->sequence;
+ rep.length = 0;
rep.width = pRoot->drawable.width;
rep.height = pRoot->drawable.height;
rep.window = stuff->window;
rep.screen = stuff->screen;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -230,7 +236,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
swapl(&rep.window);
swapl(&rep.screen);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
return Success;
}
@@ -246,12 +252,13 @@ ProcRRXineramaIsActive(ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]);
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.state);
}
- WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
return Success;
}
@@ -299,24 +306,29 @@ ProcRRXineramaQueryScreens(ClientPtr client)
{
xXineramaQueryScreensReply rep;
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
+ int n = 0;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- if (RRXineramaScreenActive(pScreen))
+ if (RRXineramaScreenActive(pScreen)) {
RRGetInfo(pScreen, FALSE);
+ n = RRXineramaScreenCount(pScreen);
+ }
+
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.number = RRXineramaScreenCount(pScreen);
- rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+ rep.length = bytes_to_int32(n * sz_XineramaScreenInfo);
+ rep.number = n;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.number);
}
- WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
- if (rep.number) {
+ if (n) {
rrScrPriv(pScreen);
int i;
int has_primary = 0;