Immutable in randr means that clients are not able to alter the
property itself, they are only allowed to alter the property value.
This logically means that the property then should not be deleted
by the client either.

Signed-off-by: Luc Verhaegen <[email protected]>
---
 randr/rrproperty.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 61e7bb4..2503d4c 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -551,18 +551,31 @@ int
 ProcRRDeleteOutputProperty (ClientPtr client)
 {
     REQUEST(xRRDeleteOutputPropertyReq);
-    RROutputPtr        output;
-              
+    RROutputPtr                output;
+    RRPropertyPtr      prop;
+
     REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
     UpdateCurrentTime();
     VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
-    
+
     if (!ValidAtom(stuff->property))
     {
        client->errorValue = stuff->property;
        return BadAtom;
     }
 
+    prop = RRQueryOutputProperty(output, stuff->property);
+    if (!prop)
+    {
+       client->errorValue = stuff->property;
+       return BadName;
+    }
+
+    if (prop->immutable)
+    {
+       client->errorValue = stuff->property;
+       return BadAccess;
+    }
 
     RRDeleteOutputProperty(output, stuff->property);
     return Success;
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to