aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrproperty.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/rrproperty.c')
-rw-r--r--xorg-server/randr/rrproperty.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/xorg-server/randr/rrproperty.c b/xorg-server/randr/rrproperty.c
index 75948fccb..dc4a9f7a3 100644
--- a/xorg-server/randr/rrproperty.c
+++ b/xorg-server/randr/rrproperty.c
@@ -66,7 +66,6 @@ static void
RRDeleteProperty(RROutputRec * output, RRPropertyRec * prop)
{
xRROutputPropertyNotifyEvent event;
-
event.type = RREventBase + RRNotify;
event.subCode = RRNotify_OutputProperty;
event.output = output->id;
@@ -138,7 +137,6 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
pointer value, Bool sendevent, Bool pending)
{
RRPropertyPtr prop;
- xRROutputPropertyNotifyEvent event;
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
int size_in_bytes;
int total_size;
@@ -237,6 +235,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
output->pendingProperties = TRUE;
if (sendevent) {
+ xRROutputPropertyNotifyEvent event;
event.type = RREventBase + RRNotify;
event.subCode = RRNotify_OutputProperty;
event.output = output->id;
@@ -378,7 +377,7 @@ int
ProcRRListOutputProperties(ClientPtr client)
{
REQUEST(xRRListOutputPropertiesReq);
- Atom *pAtoms = NULL, *temppAtoms;
+ Atom *pAtoms = NULL;
xRRListOutputPropertiesReply rep;
int numProps = 0;
RROutputPtr output;
@@ -394,21 +393,25 @@ ProcRRListOutputProperties(ClientPtr client)
if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
return BadAlloc;
+
rep.type = X_Reply;
- rep.length = bytes_to_int32(numProps * sizeof(Atom));
rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32(numProps * sizeof(Atom));
rep.nAtoms = numProps;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nAtoms);
}
- temppAtoms = pAtoms;
- for (prop = output->properties; prop; prop = prop->next)
- *temppAtoms++ = prop->propertyName;
+ WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep);
- WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
if (numProps) {
+ /* Copy property name atoms to reply buffer */
+ Atom *temppAtoms = pAtoms;
+ for (prop = output->properties; prop; prop = prop->next)
+ *temppAtoms++ = prop->propertyName;
+
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
free(pAtoms);
@@ -438,17 +441,20 @@ ProcRRQueryOutputProperty(ClientPtr client)
if (!extra)
return BadAlloc;
}
+
+
rep.type = X_Reply;
- rep.length = prop->num_valid;
rep.sequenceNumber = client->sequence;
+ rep.length = prop->num_valid;
rep.pending = prop->is_pending;
rep.range = prop->range;
rep.immutable = prop->immutable;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
- WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep);
+ WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep);
if (prop->num_valid) {
memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32));
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
@@ -594,8 +600,10 @@ ProcRRGetOutputProperty(ClientPtr client)
if (prop->propertyName == stuff->property)
break;
+
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
+
if (!prop) {
reply.nItems = 0;
reply.length = 0;
@@ -673,13 +681,13 @@ ProcRRGetOutputProperty(ClientPtr client)
if (stuff->delete && (reply.bytesAfter == 0)) {
xRROutputPropertyNotifyEvent event;
-
event.type = RREventBase + RRNotify;
event.subCode = RRNotify_OutputProperty;
event.output = output->id;
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
+
RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event);
}