aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrcrtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/rrcrtc.c')
-rw-r--r--xorg-server/randr/rrcrtc.c104
1 files changed, 51 insertions, 53 deletions
diff --git a/xorg-server/randr/rrcrtc.c b/xorg-server/randr/rrcrtc.c
index 6da698ea0..76d24f60a 100644
--- a/xorg-server/randr/rrcrtc.c
+++ b/xorg-server/randr/rrcrtc.c
@@ -238,21 +238,22 @@ RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
ScreenPtr pScreen = pWin->drawable.pScreen;
rrScrPriv(pScreen);
+ xRRCrtcChangeNotifyEvent ce;
RRModePtr mode = crtc->mode;
- xRRCrtcChangeNotifyEvent ce = {
- .type = RRNotify + RREventBase,
- .subCode = RRNotify_CrtcChange,
- .timestamp = pScrPriv->lastSetTime.milliseconds,
- .window = pWin->drawable.id,
- .crtc = crtc->id,
- .mode = mode ? mode->mode.id : None,
- .rotation = crtc->rotation,
- .x = mode ? crtc->x : 0,
- .y = mode ? crtc->y : 0,
- .width = mode ? mode->mode.width : 0,
- .height = mode ? mode->mode.height : 0
- };
+
+ ce.type = RRNotify + RREventBase;
+ ce.subCode = RRNotify_CrtcChange;
+ ce.timestamp = pScrPriv->lastSetTime.milliseconds;
+ ce.window = pWin->drawable.id;
+ ce.crtc = crtc->id;
+ ce.mode = mode ? mode->mode.id : None;
+ ce.rotation = crtc->rotation;
+ ce.x = mode ? crtc->x : 0;
+ ce.y = mode ? crtc->y : 0;
+ ce.width = mode ? mode->mode.width : 0;
+ ce.height = mode ? mode->mode.height : 0;
+
WriteEventsToClient(client, 1, (xEvent *) &ce);
}
@@ -907,13 +908,13 @@ ProcRRGetCrtcInfo(ClientPtr client)
mode = crtc->mode;
- rep = (xRRGetCrtcInfoReply) {
- .type = X_Reply,
- .status = RRSetConfigSuccess,
- .sequenceNumber = client->sequence,
- .length = 0,
- .timestamp = pScrPriv->lastSetTime.milliseconds
- };
+
+ rep.type = X_Reply;
+ rep.status = RRSetConfigSuccess;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+
if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
(panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1))
@@ -1180,13 +1181,12 @@ ProcRRSetCrtcConfig(ClientPtr client)
sendReply:
free(outputs);
- rep = (xRRSetCrtcConfigReply) {
- .type = X_Reply,
- .status = status,
- .sequenceNumber = client->sequence,
- .length = 0,
- .newTimestamp = pScrPriv->lastSetTime.milliseconds
- };
+
+ rep.type = X_Reply;
+ rep.status = status;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -1222,13 +1222,12 @@ ProcRRGetPanning(ClientPtr client)
if (!pScrPriv)
return RRErrorBase + BadRRCrtc;
- rep = (xRRGetPanningReply) {
- .type = X_Reply,
- .status = RRSetConfigSuccess,
- .sequenceNumber = client->sequence,
- .length = 1,
- .timestamp = pScrPriv->lastSetTime.milliseconds
- };
+ memset(&rep, 0, sizeof(rep));
+ rep.type = X_Reply;
+ rep.status = RRSetConfigSuccess;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 1;
+ rep.timestamp = pScrPriv->lastSetTime.milliseconds;
if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) {
@@ -1322,13 +1321,12 @@ ProcRRSetPanning(ClientPtr client)
status = RRSetConfigSuccess;
sendReply:
- rep = (xRRSetPanningReply) {
- .type = X_Reply,
- .status = status,
- .sequenceNumber = client->sequence,
- .length = 0,
- .newTimestamp = pScrPriv->lastSetTime.milliseconds
- };
+
+ rep.type = X_Reply;
+ rep.status = status;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -1353,12 +1351,12 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
if (!RRCrtcGammaGet(crtc))
return RRErrorBase + BadRRCrtc;
- reply = (xRRGetCrtcGammaSizeReply) {
- .type = X_Reply,
- .sequenceNumber = client->sequence,
- .length = 0,
- .size = crtc->gammaSize
- };
+
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = 0;
+ reply.size = crtc->gammaSize;
+
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
@@ -1392,12 +1390,12 @@ ProcRRGetCrtcGamma(ClientPtr client)
return BadAlloc;
}
- reply = (xRRGetCrtcGammaReply) {
- .type = X_Reply,
- .sequenceNumber = client->sequence,
- .length = bytes_to_int32(len),
- .size = crtc->gammaSize
- };
+
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = bytes_to_int32(len);
+ reply.size = crtc->gammaSize;
+
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);