From: Ville Syrjälä <[email protected]>

Currently a port notify event is sent even if SetPortAttribute
fails. Furthermore the value field in the event will contain the
value that was specified in the failed request. So any client
interested in the actual value of the attribute will have to
double check the current value with GetPortAttribute after
receiving a port notify event.

Fix the problem by sending port notifications only when
SetPortAttribute succeeds.

Signed-off-by: Ville Syrjälä <[email protected]>
---
 Xext/xvmain.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 1b80b12..12b4c51 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -1133,12 +1133,13 @@ XvdiSetPortAttribute(
   Atom attribute,
   INT32 value
 ){
+  int status;
 
+  status = (* pPort->pAdaptor->ddSetPortAttribute)(client, pPort, attribute, 
value);
+  if (status == Success)
     XvdiSendPortNotify(pPort, attribute, value);
 
-  return 
-    (* pPort->pAdaptor->ddSetPortAttribute)(client, pPort, attribute, value);
-
+  return status;
 }
 
 int
-- 
1.6.4.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