dix: Return Success from ProcBell if no BellProc is set.

We must not return BadDevice, this causes applications to crash. If no
BellProc is set, just quietly do nothing and report a Success.
This commit is contained in:
Peter Hutterer 2007-11-14 14:08:21 +10:30
parent 240b10fa9c
commit b44c1118f3

View File

@ -2011,8 +2011,13 @@ ProcBell(ClientPtr client)
REQUEST(xBellReq);
REQUEST_SIZE_MATCH(xBellReq);
/* Seems like no keyboard actually has the BellProc set. Returning
* BadDevice (previous code) will make apps crash badly. The man pages
* doesn't say anything about a BadDevice being returned either.
* So just quietly do nothing and pretend everything has worked.
*/
if (!keybd->kbdfeed->BellProc)
return BadDevice;
return Success;
if (stuff->percent < -100 || stuff->percent > 100) {
client->errorValue = stuff->percent;