Skip to content

Commit

Permalink
xv: Don't send port notify when SetPortAttribute fails
Browse files Browse the repository at this point in the history
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]>
Reviewed-by: Keith Packard <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
  • Loading branch information
Ville Syrjälä authored and keith-packard committed Jun 22, 2010
1 parent c201667 commit f7dae97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Xext/xvmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7dae97

Please sign in to comment.