summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2011-07-29 16:12:06 -0700
committerKeith Packard <keithp@keithp.com>2011-07-29 16:41:53 -0700
commit08dfff92e8d0c2b1726634392c147f6634d1706d (patch)
treeb20751f1ff50c6cb9d8813dad31d53dd4904ab00
parentb8f61c11c94708d4f17720a55945dee4621315a4 (diff)
randr: Compare all the bytes in RRPostPendingProperties
RRPostPendingProperties tries to compare the pending and current property values to decide whether they're actually changing. However, it does this using a memcmp that passes in pending_value->size as the number of bytes. This is actually the number of elements, where each element is (pending_value->format / 8) bytes long. This causes the pending value to not be propagated if the first pending_value->size bytes are the same and only the end of it is changing. Fix this by computing the total number of bytes to compare in the memcmp. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--randr/rrproperty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index ba04c16e2..61e7bb45a 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -283,7 +283,7 @@ RRPostPendingProperties (RROutputPtr output)
pending_value->format == current_value->format &&
pending_value->size == current_value->size &&
!memcmp (pending_value->data, current_value->data,
- pending_value->size))
+ pending_value->size * (pending_value->format / 8)))
continue;
if (RRChangeOutputProperty (output, property->propertyName,