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 69b3ecf0f..7c59293fe 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);
}
@@ -908,13 +909,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))
@@ -1181,13 +1182,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);
@@ -1223,13 +1223,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)) {
@@ -1323,13 +1322,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);
@@ -1354,12 +1352,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);
@@ -1393,12 +1391,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);