summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-01-11 16:35:36 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-02-22 12:04:36 +1000
commit02d1116e7eb84068fa32477f1640d29b0a81b638 (patch)
treede23e60391dee3b2f70a2db872e166a5218844b0 /Xi
parent122fc0e7a0712df4ec2bd9ca6773f90bcd2095cf (diff)
Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode.
The XI protocol spec only allows for two errors on the SetDeviceMode requests: BadMatch or BadMode. BadMode however is a dynamically assigned extension error and the driver doesn't have access to the actual error number. Hence, if a SetDeviceMode driver returns an error other than BadMatch, assume BadMode. The two exceptions are BadAlloc and BadImplementations, pass these on to the client (any request is allowed to return either of those). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/setmode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Xi/setmode.c b/Xi/setmode.c
index 51e57675f..ce2ad47c7 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -112,7 +112,17 @@ ProcXSetDeviceMode(ClientPtr client)
if (rep.status == Success)
dev->valuator->mode = stuff->mode;
else if (rep.status != AlreadyGrabbed)
+ {
+ switch(rep.status) {
+ case BadMatch:
+ case BadImplementation:
+ case BadAlloc:
+ break;
+ default:
+ rep.status = BadMode;
+ }
return rep.status;
+ }
WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
return Success;