xv: Don't send port notify when SetPortAttribute fails

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ä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Ville Syrjälä 2010-06-15 23:25:34 +03:00 committed by Keith Packard
parent c201667396
commit f7dae972aa

View File

@ -1133,12 +1133,13 @@ XvdiSetPortAttribute(
Atom attribute, Atom attribute,
INT32 value INT32 value
){ ){
int status;
status = (* pPort->pAdaptor->ddSetPortAttribute)(client, pPort, attribute, value);
if (status == Success)
XvdiSendPortNotify(pPort, attribute, value); XvdiSendPortNotify(pPort, attribute, value);
return return status;
(* pPort->pAdaptor->ddSetPortAttribute)(client, pPort, attribute, value);
} }
int int