diff options
Diffstat (limited to 'xorg-server/randr/rrprovider.c')
-rw-r--r-- | xorg-server/randr/rrprovider.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/xorg-server/randr/rrprovider.c b/xorg-server/randr/rrprovider.c index 3ce7d75b0..66527542e 100644 --- a/xorg-server/randr/rrprovider.c +++ b/xorg-server/randr/rrprovider.c @@ -89,23 +89,23 @@ ProcRRGetProviders (ClientPtr client) if (!pScrPriv) { - rep = (xRRGetProvidersReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .timestamp = currentTime.milliseconds, - .nProviders = 0 - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = currentTime.milliseconds; + rep.nProviders = 0; + extra = NULL; extraLen = 0; } else { - rep = (xRRGetProvidersReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .timestamp = pScrPriv->lastSetTime.milliseconds, - .nProviders = total_providers, - .length = total_providers - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.nProviders = total_providers; + rep.length = total_providers; + extraLen = rep.length << 2; if (extraLen) { extra = malloc(extraLen); @@ -166,18 +166,18 @@ ProcRRGetProviderInfo (ClientPtr client) pScreen = provider->pScreen; pScrPriv = rrGetScrPriv(pScreen); - 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 - }; + + rep.type = X_Reply; + rep.status = RRSetConfigSuccess; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.capabilities = provider->capabilities; + rep.nameLength = provider->nameLength; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.nCrtcs = pScrPriv->numCrtcs; + rep.nOutputs = pScrPriv->numOutputs; + rep.nAssociatedProviders = 0; + /* count associated providers */ if (provider->offload_sink) @@ -428,16 +428,17 @@ void RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) { ScreenPtr pScreen = pWin->drawable.pScreen; + xRRProviderChangeNotifyEvent pe; rrScrPriv(pScreen); - xRRProviderChangeNotifyEvent pe = { - .type = RRNotify + RREventBase, - .subCode = RRNotify_ProviderChange, - .timestamp = pScrPriv->lastSetTime.milliseconds, - .window = pWin->drawable.id, - .provider = provider->id - }; + + pe.type = RRNotify + RREventBase; + pe.subCode = RRNotify_ProviderChange; + pe.timestamp = pScrPriv->lastSetTime.milliseconds; + pe.window = pWin->drawable.id; + pe.provider = provider->id; + WriteEventsToClient(client, 1, (xEvent *) &pe); } |