diff options
Diffstat (limited to 'xorg-server/randr/rrscreen.c')
-rw-r--r-- | xorg-server/randr/rrscreen.c | 194 |
1 files changed, 96 insertions, 98 deletions
diff --git a/xorg-server/randr/rrscreen.c b/xorg-server/randr/rrscreen.c index 36179ae89..22a7e984f 100644 --- a/xorg-server/randr/rrscreen.c +++ b/xorg-server/randr/rrscreen.c @@ -68,19 +68,18 @@ void RRSendConfigNotify(ScreenPtr pScreen) { WindowPtr pWin = pScreen->root; - xEvent event = { - .u.configureNotify.window = pWin->drawable.id, - .u.configureNotify.aboveSibling = None, - .u.configureNotify.x = 0, - .u.configureNotify.y = 0, + xEvent event; + event.u.configureNotify.window = pWin->drawable.id; + event.u.configureNotify.aboveSibling = None; + event.u.configureNotify.x = 0; + event.u.configureNotify.y = 0; /* XXX xinerama stuff ? */ - .u.configureNotify.width = pWin->drawable.width, - .u.configureNotify.height = pWin->drawable.height, - .u.configureNotify.borderWidth = wBorderWidth(pWin), - .u.configureNotify.override = pWin->overrideRedirect - }; + event.u.configureNotify.width = pWin->drawable.width; + event.u.configureNotify.height = pWin->drawable.height; + event.u.configureNotify.borderWidth = wBorderWidth(pWin); + event.u.configureNotify.override = pWin->overrideRedirect; event.u.u.type = ConfigureNotify; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -89,20 +88,21 @@ void RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) { rrScrPriv(pScreen); + xRRScreenChangeNotifyEvent se; RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; WindowPtr pRoot = pScreen->root; - xRRScreenChangeNotifyEvent se = { - .type = RRScreenChangeNotify + RREventBase, - .rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0), - .timestamp = pScrPriv->lastSetTime.milliseconds, - .configTimestamp = pScrPriv->lastConfigTime.milliseconds, - .root = pRoot->drawable.id, - .window = pWin->drawable.id, - .subpixelOrder = PictureGetSubpixelOrder(pScreen), - .sizeID = RR10CurrentSizeID(pScreen) - }; + se.type = RRScreenChangeNotify + RREventBase; + se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); + se.timestamp = pScrPriv->lastSetTime.milliseconds; + se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + se.root = pRoot->drawable.id; + se.window = pWin->drawable.id; + se.subpixelOrder = PictureGetSubpixelOrder(pScreen); + + se.sizeID = RR10CurrentSizeID(pScreen); + if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { se.widthInPixels = pScreen->height; @@ -201,12 +201,11 @@ ProcRRGetScreenSizeRange(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep = (xRRGetScreenSizeRangeReply) { - .type = X_Reply, - .pad = 0, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.type = X_Reply; + rep.pad = 0; + rep.sequenceNumber = client->sequence; + rep.length = 0; if (pScrPriv) { if (!RRGetInfo(pScreen, FALSE)) @@ -396,17 +395,17 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len); pScrPriv = rrGetScrPriv(pScreen); - rep = (xRRGetScreenResourcesReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .timestamp = pScrPriv->lastSetTime.milliseconds, - .configTimestamp = pScrPriv->lastConfigTime.milliseconds, - .nCrtcs = total_crtcs, - .nOutputs = total_outputs, - .nModes = total_modes, - .nbytesNames = total_name_len - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.nCrtcs = total_crtcs; + rep.nOutputs = total_outputs; + rep.nModes = total_modes; + rep.nbytesNames = total_name_len; + rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) + bytes_to_int32(rep.nbytesNames)); @@ -482,6 +481,7 @@ rrGetScreenResources(ClientPtr client, Bool query) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); + rep.pad = 0; if (query && pScrPriv) if (!RRGetInfo(pScreen, query)) @@ -491,17 +491,17 @@ rrGetScreenResources(ClientPtr client, Bool query) return rrGetMultiScreenResources(client, query, pScreen); if (!pScrPriv) { - rep = (xRRGetScreenResourcesReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .timestamp = currentTime.milliseconds, - .configTimestamp = currentTime.milliseconds, - .nCrtcs = 0, - .nOutputs = 0, - .nModes = 0, - .nbytesNames = 0 - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = currentTime.milliseconds; + rep.configTimestamp = currentTime.milliseconds; + rep.nCrtcs = 0; + rep.nOutputs = 0; + rep.nModes = 0; + rep.nbytesNames = 0; + extra = NULL; extraLen = 0; } @@ -513,17 +513,16 @@ rrGetScreenResources(ClientPtr client, Bool query) if (!modes) return BadAlloc; - 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 - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.nCrtcs = pScrPriv->numCrtcs; + rep.nOutputs = pScrPriv->numOutputs; + rep.nModes = num_modes; + rep.nbytesNames = 0; for (i = 0; i < num_modes; i++) @@ -749,6 +748,7 @@ ProcRRGetScreenInfo(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); + rep.pad = 0; if (pScrPriv) if (!RRGetInfo(pScreen, TRUE)) @@ -757,20 +757,20 @@ ProcRRGetScreenInfo(ClientPtr client) output = RRFirstOutput(pScreen); if (!pScrPriv || !output) { - rep = (xRRGetScreenInfoReply) { - .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 - }; + + rep.type = X_Reply; + rep.setOfRotations = RR_Rotate_0; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.root = pWin->drawable.pScreen->root->drawable.id; + rep.timestamp = currentTime.milliseconds; + rep.configTimestamp = currentTime.milliseconds; + rep.nSizes = 0; + rep.sizeID = 0; + rep.rotation = RR_Rotate_0; + rep.rate = 0; + rep.nrateEnts = 0; + extra = 0; extraLen = 0; } @@ -787,20 +787,19 @@ ProcRRGetScreenInfo(ClientPtr client) if (!pData) return BadAlloc; - rep = (xRRGetScreenInfoReply) { - .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, - .rotation = output->crtc->rotation, - .nSizes = pData->nsize, - .nrateEnts = pData->nrefresh + pData->nsize, - .sizeID = pData->size, - .rate = pData->refresh - }; + + rep.type = X_Reply; + rep.setOfRotations = output->crtc->rotations; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.root = pWin->drawable.pScreen->root->drawable.id; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.rotation = output->crtc->rotation; + rep.nSizes = pData->nsize; + rep.nrateEnts = pData->nrefresh + pData->nsize; + rep.sizeID = pData->size; + rep.rate = pData->refresh; extraLen = rep.nSizes * sizeof(xScreenSizes); if (has_rate) @@ -1086,17 +1085,16 @@ ProcRRSetScreenConfig(ClientPtr client) free(pData); - 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, - /* .subpixelOrder = ?? */ - }; + + rep.type = X_Reply; + rep.status = status; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; + rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.root = pDraw->pScreen->root->drawable.id; + if (client->swapped) { swaps(&rep.sequenceNumber); |