mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-09 15:30:29 +01:00
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> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
03ef00ae79
commit
e40ba5798c
1 changed files with 10 additions and 0 deletions
10
Xi/setmode.c
10
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue