Input: Add DeleteInputDeviceRequest

Add DIDR, which asks the DDX to remove a device, analogous to
NewInputDeviceRequest.  Only implemented for XFree86 at the moment.
This commit is contained in:
Magnus Vigerlöf 2007-04-10 23:54:32 +03:00 • committed by Daniel Stone
commit 82962bbae2
6 changed files with 43 additions and 1 deletions

View file

@ -427,6 +427,26 @@ unwind:
return rval;
}
void
DeleteInputDeviceRequest(DeviceIntPtr pDev)
{
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
InputDriverPtr drv = pInfo->drv;
IDevRec *idev = pInfo->conf_idev;
RemoveDevice(pDev);
if(drv->UnInit)
drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
xfree(idev->driver);
xfree(idev->identifier);
xf86optionListFree(idev->commonOptions);
xfree(idev);
}
/*
* convenient functions to post events
*/