Revert "randr: use struct initializer for reply structs"

This reverts commit 7eff742ef2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
This commit is contained in:
Alan Coopersmith 2025-06-11 13:43:47 -07:00
parent 9c53c6cf76
commit 160abf285c
12 changed files with 196 additions and 87 deletions

View File

@ -1022,16 +1022,18 @@ static void
RRModeGetScanoutSize(RRModePtr mode, PictTransformPtr transform,
int *width, int *height)
{
BoxRec box;
if (mode == NULL) {
*width = 0;
*height = 0;
return;
}
BoxRec box = {
.x2 = mode->mode.width,
.y2 = mode->mode.height,
};
box.x1 = 0;
box.y1 = 0;
box.x2 = mode->mode.width;
box.y2 = mode->mode.height;
pixman_transform_bounds(transform, &box);
*width = box.x2 - box.x1;
@ -1145,9 +1147,10 @@ int
ProcRRGetCrtcInfo(ClientPtr client)
{
REQUEST(xRRGetCrtcInfoReq);
xRRGetCrtcInfoReply rep;
RRCrtcPtr crtc;
CARD8 *extra = NULL;
unsigned long extraLen = 0;
unsigned long extraLen;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
RRModePtr mode;
@ -1171,17 +1174,22 @@ ProcRRGetCrtcInfo(ClientPtr client)
mode = crtc->mode;
xRRGetCrtcInfoReply rep = {
rep = (xRRGetCrtcInfoReply) {
.type = X_Reply,
.status = RRSetConfigSuccess,
.sequenceNumber = client->sequence,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.rotation = crtc->rotation,
.rotations = crtc->rotations,
.length = 0,
.timestamp = pScrPriv->lastSetTime.milliseconds
};
if (leased) {
rep.x = rep.y = rep.width = rep.height = 0;
rep.mode = 0;
rep.rotation = RR_Rotate_0;
rep.rotations = RR_Rotate_0;
rep.nOutput = 0;
rep.nPossibleOutput = 0;
rep.length = 0;
extraLen = 0;
} else {
if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
@ -1200,18 +1208,23 @@ ProcRRGetCrtcInfo(ClientPtr client)
rep.height = height;
}
rep.mode = mode ? mode->mode.id : 0;
rep.rotation = crtc->rotation;
rep.rotations = crtc->rotations;
rep.nOutput = crtc->numOutputs;
k = 0;
for (i = 0; i < pScrPriv->numOutputs; i++) {
if (!RROutputIsLeased(pScrPriv->outputs[i])) {
for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++)
if (pScrPriv->outputs[i]->crtcs[j] == crtc)
rep.nPossibleOutput++;
k++;
}
}
extraLen = (rep.nOutput + rep.nPossibleOutput) * sizeof(CARD32);
rep.length = bytes_to_int32(extraLen);
rep.nPossibleOutput = k;
rep.length = rep.nOutput + rep.nPossibleOutput;
extraLen = rep.length << 2;
if (extraLen) {
extra = malloc(extraLen);
if (!extra)
@ -1270,6 +1283,7 @@ int
ProcRRSetCrtcConfig(ClientPtr client)
{
REQUEST(xRRSetCrtcConfigReq);
xRRSetCrtcConfigReply rep;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
RRCrtcPtr crtc;
@ -1461,10 +1475,11 @@ ProcRRSetCrtcConfig(ClientPtr client)
sendReply:
free(outputs);
xRRSetCrtcConfigReply rep = {
rep = (xRRSetCrtcConfigReply) {
.type = X_Reply,
.status = status,
.sequenceNumber = client->sequence,
.length = 0,
.newTimestamp = pScrPriv->lastSetTime.milliseconds
};
@ -1482,6 +1497,7 @@ int
ProcRRGetPanning(ClientPtr client)
{
REQUEST(xRRGetPanningReq);
xRRGetPanningReply rep;
RRCrtcPtr crtc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
@ -1501,7 +1517,7 @@ ProcRRGetPanning(ClientPtr client)
if (!pScrPriv)
return RRErrorBase + BadRRCrtc;
xRRGetPanningReply rep = {
rep = (xRRGetPanningReply) {
.type = X_Reply,
.status = RRSetConfigSuccess,
.sequenceNumber = client->sequence,
@ -1625,6 +1641,7 @@ int
ProcRRGetCrtcGammaSize(ClientPtr client)
{
REQUEST(xRRGetCrtcGammaSizeReq);
xRRGetCrtcGammaSizeReply reply;
RRCrtcPtr crtc;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
@ -1634,9 +1651,10 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
if (!RRCrtcGammaGet(crtc))
return RRErrorBase + BadRRCrtc;
xRRGetCrtcGammaSizeReply reply = {
reply = (xRRGetCrtcGammaSizeReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.size = crtc->gammaSize
};
if (client->swapped) {
@ -1652,6 +1670,7 @@ int
ProcRRGetCrtcGamma(ClientPtr client)
{
REQUEST(xRRGetCrtcGammaReq);
xRRGetCrtcGammaReply reply;
RRCrtcPtr crtc;
unsigned long len;
char *extra = NULL;
@ -1671,7 +1690,7 @@ ProcRRGetCrtcGamma(ClientPtr client)
return BadAlloc;
}
xRRGetCrtcGammaReply reply = {
reply = (xRRGetCrtcGammaReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(len),

View File

@ -42,6 +42,7 @@ ProcRRQueryVersion(ClientPtr client)
xRRQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
REQUEST(xRRQueryVersionReq);
rrClientPriv(client);

View File

@ -250,18 +250,19 @@ RRRegisterSize(ScreenPtr pScreen,
{
rrScrPriv(pScreen);
int i;
RRScreenSize tmp;
RRScreenSizePtr pNew;
if (!pScrPriv)
return 0;
RRScreenSize tmp = {
.width = width,
.height = height,
.mmWidth = mmWidth,
.mmHeight = mmHeight,
};
tmp.id = 0;
tmp.width = width;
tmp.height = height;
tmp.mmWidth = mmWidth;
tmp.mmHeight = mmHeight;
tmp.pRates = 0;
tmp.nRates = 0;
for (i = 0; i < pScrPriv->nSizes; i++)
if (RRScreenSizeMatches(&tmp, &pScrPriv->pSizes[i]))
return &pScrPriv->pSizes[i];

View File

@ -213,6 +213,7 @@ int
ProcRRCreateLease(ClientPtr client)
{
REQUEST(xRRCreateLeaseReq);
xRRCreateLeaseReply rep;
WindowPtr window;
ScreenPtr screen;
rrScrPrivPtr scr_priv;
@ -333,10 +334,11 @@ leaseReturned:
RRLeaseChangeState(lease, RRLeaseCreating, RRLeaseRunning);
xRRCreateLeaseReply rep = {
rep = (xRRCreateLeaseReply) {
.type = X_Reply,
.nfd = 1,
.sequenceNumber = client->sequence,
.length = 0,
};
if (client->swapped) {

View File

@ -286,6 +286,7 @@ int
ProcRRCreateMode(ClientPtr client)
{
REQUEST(xRRCreateModeReq);
xRRCreateModeReply rep;
WindowPtr pWin;
ScreenPtr pScreen;
xRRModeInfo *modeInfo;
@ -313,12 +314,12 @@ ProcRRCreateMode(ClientPtr client)
if (!mode)
return error;
xRRCreateModeReply rep = {
rep = (xRRCreateModeReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.mode = mode->mode.id
};
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);

View File

@ -581,6 +581,11 @@ int
ProcRRGetMonitors(ClientPtr client)
{
REQUEST(xRRGetMonitorsReq);
xRRGetMonitorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
};
WindowPtr window;
ScreenPtr screen;
int r;
@ -599,19 +604,17 @@ ProcRRGetMonitors(ClientPtr client)
if (!RRMonitorMakeList(screen, get_active, &monitors, &nmonitors))
return BadAlloc;
rep.timestamp = RRMonitorTimestamp(screen);
noutputs = 0;
for (m = 0; m < nmonitors; m++) {
rep.length += SIZEOF(xRRMonitorInfo) >> 2;
rep.length += monitors[m].numOutputs;
noutputs += monitors[m].numOutputs;
}
xRRGetMonitorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.timestamp = RRMonitorTimestamp(screen),
.length = noutputs + nmonitors * bytes_to_int32(sizeof(xRRMonitorInfo)),
.nmonitors = nmonitors,
.noutputs = noutputs,
};
rep.nmonitors = nmonitors;
rep.noutputs = noutputs;
if (client->swapped) {
swaps(&rep.sequenceNumber);

View File

@ -481,8 +481,15 @@ ProcRRGetOutputInfo(ClientPtr client)
.sequenceNumber = client->sequence,
.length = bytes_to_int32(OutputInfoExtra),
.timestamp = pScrPriv->lastSetTime.milliseconds,
.crtc = None,
.mmWidth = 0,
.mmHeight = 0,
.connection = RR_Disconnected,
.subpixelOrder = SubPixelUnknown,
.nCrtcs = 0,
.nModes = 0,
.nPreferred = 0,
.nClones = 0,
.nameLength = output->nameLength
};
extraLen = bytes_to_int32(rep.nameLength) << 2;
@ -651,6 +658,7 @@ ProcRRGetOutputPrimary(ClientPtr client)
REQUEST(xRRGetOutputPrimaryReq);
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
xRRGetOutputPrimaryReply rep;
RROutputPtr primary = NULL;
int rc;
@ -664,7 +672,7 @@ ProcRRGetOutputPrimary(ClientPtr client)
if (pScrPriv)
primary = pScrPriv->primaryOutput;
xRRGetOutputPrimaryReply rep = {
rep = (xRRGetOutputPrimaryReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.output = primary ? primary->id : None

View File

@ -417,6 +417,7 @@ ProcRRListOutputProperties(ClientPtr client)
{
REQUEST(xRRListOutputPropertiesReq);
Atom *pAtoms = NULL;
xRRListOutputPropertiesReply rep;
int numProps = 0;
RROutputPtr output;
RRPropertyPtr prop;
@ -431,7 +432,7 @@ ProcRRListOutputProperties(ClientPtr client)
if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
return BadAlloc;
xRRListOutputPropertiesReply rep = {
rep = (xRRListOutputPropertiesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(numProps * sizeof(Atom)),
@ -461,6 +462,7 @@ int
ProcRRQueryOutputProperty(ClientPtr client)
{
REQUEST(xRRQueryOutputPropertyReq);
xRRQueryOutputPropertyReply rep;
RROutputPtr output;
RRPropertyPtr prop;
char *extra = NULL;
@ -479,7 +481,7 @@ ProcRRQueryOutputProperty(ClientPtr client)
return BadAlloc;
}
xRRQueryOutputPropertyReply rep = {
rep = (xRRQueryOutputPropertyReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = prop->num_valid,
@ -618,6 +620,7 @@ ProcRRGetOutputProperty(ClientPtr client)
RRPropertyValuePtr prop_value;
unsigned long n, len, ind;
RROutputPtr output;
xRRGetOutputPropertyReply reply;
char *extra = NULL;
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
@ -643,14 +646,22 @@ ProcRRGetOutputProperty(ClientPtr client)
if (prop->propertyName == stuff->property)
break;
xRRGetOutputPropertyReply reply = {
reply = (xRRGetOutputPropertyReply) {
.type = X_Reply,
.sequenceNumber = client->sequence
};
if (!prop) {
reply.nItems = 0;
reply.length = 0;
reply.bytesAfter = 0;
reply.propertyType = None;
reply.format = 0;
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return Success;
@ -670,11 +681,15 @@ ProcRRGetOutputProperty(ClientPtr client)
) {
reply.bytesAfter = prop_value->size;
reply.format = prop_value->format;
reply.length = 0;
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return Success;
@ -706,6 +721,8 @@ ProcRRGetOutputProperty(ClientPtr client)
reply.length = bytes_to_int32(len);
if (prop_value->format)
reply.nItems = len / (prop_value->format / 8);
else
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (stuff->delete && (reply.bytesAfter == 0)) {

View File

@ -56,6 +56,7 @@ int
ProcRRGetProviders (ClientPtr client)
{
REQUEST(xRRGetProvidersReq);
xRRGetProvidersReply rep;
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
@ -86,36 +87,36 @@ ProcRRGetProviders (ClientPtr client)
if (!pScrPriv)
{
xRRGetProvidersReply rep = {
rep = (xRRGetProvidersReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.timestamp = currentTime.milliseconds,
.nProviders = 0
};
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
extraLen = total_providers * sizeof(CARD32);
xRRGetProvidersReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.nProviders = total_providers,
.length = bytes_to_int32(extraLen),
};
if (extraLen) {
extra = malloc(extraLen);
if (!extra)
return BadAlloc;
} else
extra = NULL;
extraLen = 0;
} else {
rep = (xRRGetProvidersReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.nProviders = total_providers,
.length = total_providers
};
extraLen = rep.length << 2;
if (extraLen) {
extra = malloc(extraLen);
if (!extra)
return BadAlloc;
} else
extra = NULL;
providers = (RRProvider *)extra;
ADD_PROVIDER(pScreen);
xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
ADD_PROVIDER(iter);
providers = (RRProvider *)extra;
ADD_PROVIDER(pScreen);
xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
ADD_PROVIDER(iter);
}
}
if (client->swapped) {
@ -137,6 +138,7 @@ int
ProcRRGetProviderInfo (ClientPtr client)
{
REQUEST(xRRGetProviderInfoReq);
xRRGetProviderInfoReply rep;
rrScrPrivPtr pScrPriv, pScrProvPriv;
RRProviderPtr provider;
ScreenPtr pScreen;
@ -156,15 +158,17 @@ ProcRRGetProviderInfo (ClientPtr client)
pScreen = provider->pScreen;
pScrPriv = rrGetScrPriv(pScreen);
xRRGetProviderInfoReply rep = {
rep = (xRRGetProviderInfoReply) {
.type = X_Reply,
.status = RRSetConfigSuccess,
.sequenceNumber = client->sequence,
.length = 0,
.capabilities = provider->capabilities,
.nameLength = provider->nameLength,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.nCrtcs = pScrPriv->numCrtcs,
.nOutputs = pScrPriv->numOutputs,
.nAssociatedProviders = 0
};
/* count associated providers */

View File

@ -391,6 +391,7 @@ ProcRRListProviderProperties(ClientPtr client)
{
REQUEST(xRRListProviderPropertiesReq);
Atom *pAtoms = NULL, *temppAtoms;
xRRListProviderPropertiesReply rep;
int numProps = 0;
RRProviderPtr provider;
RRPropertyPtr prop;
@ -405,7 +406,7 @@ ProcRRListProviderProperties(ClientPtr client)
if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
return BadAlloc;
xRRListProviderPropertiesReply rep = {
rep = (xRRListProviderPropertiesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(numProps * sizeof(Atom)),
@ -433,6 +434,7 @@ int
ProcRRQueryProviderProperty(ClientPtr client)
{
REQUEST(xRRQueryProviderPropertyReq);
xRRQueryProviderPropertyReply rep;
RRProviderPtr provider;
RRPropertyPtr prop;
char *extra = NULL;
@ -450,8 +452,7 @@ ProcRRQueryProviderProperty(ClientPtr client)
if (!extra)
return BadAlloc;
}
xRRQueryProviderPropertyReply rep = {
rep = (xRRQueryProviderPropertyReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = prop->num_valid,
@ -613,8 +614,17 @@ ProcRRGetProviderProperty(ClientPtr client)
break;
if (!prop) {
reply.nItems = 0;
reply.length = 0;
reply.bytesAfter = 0;
reply.propertyType = None;
reply.format = 0;
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply);
return Success;
@ -634,11 +644,15 @@ ProcRRGetProviderProperty(ClientPtr client)
) {
reply.bytesAfter = prop_value->size;
reply.format = prop_value->format;
reply.length = 0;
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply);
return Success;
@ -670,6 +684,8 @@ ProcRRGetProviderProperty(ClientPtr client)
reply.length = bytes_to_int32(len);
if (prop_value->format)
reply.nItems = len / (prop_value->format / 8);
else
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (stuff->delete && (reply.bytesAfter == 0)) {

View File

@ -76,6 +76,8 @@ RRSendConfigNotify(ScreenPtr pScreen)
xEvent event = {
.u.configureNotify.window = pWin->drawable.id,
.u.configureNotify.aboveSibling = None,
.u.configureNotify.x = 0,
.u.configureNotify.y = 0,
/* XXX xinerama stuff ? */
@ -190,6 +192,7 @@ int
ProcRRGetScreenSizeRange(ClientPtr client)
{
REQUEST(xRRGetScreenSizeRangeReq);
xRRGetScreenSizeRangeReply rep;
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
@ -203,9 +206,11 @@ ProcRRGetScreenSizeRange(ClientPtr client)
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
xRRGetScreenSizeRangeReply rep = {
rep = (xRRGetScreenSizeRangeReply) {
.type = X_Reply,
.pad = 0,
.sequenceNumber = client->sequence,
.length = 0
};
if (pScrPriv) {
@ -367,6 +372,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
rrScrPrivPtr pScrPriv;
int num_modes;
RRModePtr *modes;
xRRGetScreenResourcesReply rep;
unsigned long extraLen;
CARD8 *extra;
RRCrtc *crtcs;
@ -403,10 +409,10 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
}
pScrPriv = rrGetScrPriv(pScreen);
xRRGetScreenResourcesReply rep = {
rep = (xRRGetScreenResourcesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.configTimestamp = pScrPriv->lastConfigTime.milliseconds,
.nCrtcs = total_crtcs,
@ -485,8 +491,8 @@ rrGetScreenResources(ClientPtr client, Bool query)
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
CARD8 *extra = NULL;
unsigned long extraLen = 0;
CARD8 *extra;
unsigned long extraLen;
int i, rc, has_primary = 0;
RRCrtc *crtcs;
RROutput *outputs;
@ -512,9 +518,16 @@ rrGetScreenResources(ClientPtr client, Bool query)
rep = (xRRGetScreenResourcesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.timestamp = currentTime.milliseconds,
.configTimestamp = currentTime.milliseconds,
.nCrtcs = 0,
.nOutputs = 0,
.nModes = 0,
.nbytesNames = 0
};
extra = NULL;
extraLen = 0;
}
else {
RRModePtr *modes;
@ -527,13 +540,16 @@ rrGetScreenResources(ClientPtr client, Bool query)
rep = (xRRGetScreenResourcesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.configTimestamp = pScrPriv->lastConfigTime.milliseconds,
.nCrtcs = pScrPriv->numCrtcs,
.nOutputs = pScrPriv->numOutputs,
.nModes = num_modes,
.nbytesNames = 0
};
for (i = 0; i < num_modes; i++)
rep.nbytesNames += modes[i]->mode.nameLength;
@ -746,8 +762,8 @@ ProcRRGetScreenInfo(ClientPtr client)
int rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
CARD8 *extra = NULL;
unsigned long extraLen = 0;
CARD8 *extra;
unsigned long extraLen;
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
@ -769,11 +785,18 @@ ProcRRGetScreenInfo(ClientPtr client)
.type = X_Reply,
.setOfRotations = RR_Rotate_0,
.sequenceNumber = client->sequence,
.length = 0,
.root = pWin->drawable.pScreen->root->drawable.id,
.timestamp = currentTime.milliseconds,
.configTimestamp = currentTime.milliseconds,
.nSizes = 0,
.sizeID = 0,
.rotation = RR_Rotate_0,
.rate = 0,
.nrateEnts = 0
};
extra = 0;
extraLen = 0;
}
else {
int i, j;
@ -792,6 +815,7 @@ ProcRRGetScreenInfo(ClientPtr client)
.type = X_Reply,
.setOfRotations = output->crtc->rotations,
.sequenceNumber = client->sequence,
.length = 0,
.root = pWin->drawable.pScreen->root->drawable.id,
.timestamp = pScrPriv->lastSetTime.milliseconds,
.configTimestamp = pScrPriv->lastConfigTime.milliseconds,
@ -881,6 +905,7 @@ int
ProcRRSetScreenConfig(ClientPtr client)
{
REQUEST(xRRSetScreenConfigReq);
xRRSetScreenConfigReply rep;
DrawablePtr pDraw;
int rc;
ScreenPtr pScreen;
@ -1085,10 +1110,12 @@ ProcRRSetScreenConfig(ClientPtr client)
free(pData);
xRRSetScreenConfigReply rep = {
rep = (xRRSetScreenConfigReply) {
.type = X_Reply,
.status = status,
.sequenceNumber = client->sequence,
.length = 0,
.newTimestamp = pScrPriv->lastSetTime.milliseconds,
.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds,
.root = pDraw->pScreen->root->drawable.id,

View File

@ -99,6 +99,7 @@ ProcRRXineramaQueryVersion(ClientPtr client)
xPanoramiXQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION,
.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION
};
@ -119,6 +120,7 @@ ProcRRXineramaGetState(ClientPtr client)
{
REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin;
xPanoramiXGetStateReply rep;
register int rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
@ -136,10 +138,11 @@ ProcRRXineramaGetState(ClientPtr client)
active = TRUE;
}
xPanoramiXGetStateReply rep = {
rep = (xPanoramiXGetStateReply) {
.type = X_Reply,
.state = active,
.sequenceNumber = client->sequence,
.length = 0,
.window = stuff->window
};
if (client->swapped) {
@ -168,6 +171,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin;
xPanoramiXGetScreenCountReply rep;
register int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
@ -175,10 +179,11 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
if (rc != Success)
return rc;
xPanoramiXGetScreenCountReply rep = {
rep = (xPanoramiXGetScreenCountReply) {
.type = X_Reply,
.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen),
.sequenceNumber = client->sequence,
.length = 0,
.window = stuff->window
};
if (client->swapped) {
@ -196,6 +201,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin, pRoot;
ScreenPtr pScreen;
xPanoramiXGetScreenSizeReply rep;
register int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
@ -206,9 +212,10 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
pScreen = pWin->drawable.pScreen;
pRoot = pScreen->root;
xPanoramiXGetScreenSizeReply rep = {
rep = (xPanoramiXGetScreenSizeReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.width = pRoot->drawable.width,
.height = pRoot->drawable.height,
.window = stuff->window,
@ -229,11 +236,13 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
int
ProcRRXineramaIsActive(ClientPtr client)
{
xXineramaIsActiveReply rep;
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
xXineramaIsActiveReply rep = {
rep = (xXineramaIsActiveReply) {
.type = X_Reply,
.length = 0,
.sequenceNumber = client->sequence,
.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
};
@ -249,12 +258,12 @@ ProcRRXineramaIsActive(ClientPtr client)
static void
RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor)
{
xXineramaScreenInfo scratch = {
.x_org = monitor->geometry.box.x1,
.y_org = monitor->geometry.box.y1,
.width = monitor->geometry.box.x2 - monitor->geometry.box.x1,
.height = monitor->geometry.box.y2 - monitor->geometry.box.y1,
};
xXineramaScreenInfo scratch;
scratch.x_org = monitor->geometry.box.x1;
scratch.y_org = monitor->geometry.box.y1;
scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1;
scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1;
if (client->swapped) {
swaps(&scratch.x_org);
@ -269,6 +278,7 @@ RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor)
int
ProcRRXineramaQueryScreens(ClientPtr client)
{
xXineramaQueryScreensReply rep;
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
int m;
RRMonitorPtr monitors = NULL;
@ -282,7 +292,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
return BadAlloc;
}
xXineramaQueryScreensReply rep = {
rep = (xXineramaQueryScreensReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(nmonitors * sz_XineramaScreenInfo),