diff options
author | Magnus Vigerlöf <Magnus.Vigerlof@home.se> | 2007-04-10 23:54:32 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2007-04-10 23:58:20 +0300 |
commit | 82962bbae2b4fda274625d1712ef839ce1ab9dc8 (patch) | |
tree | adae2c3d6608872be2a42c3c0a1a077f4b5f8b1e /hw | |
parent | 7b82a836c66ba88566255052caff63577e1a0384 (diff) |
Input: Add DeleteInputDeviceRequest
Add DIDR, which asks the DDX to remove a device, analogous to
NewInputDeviceRequest. Only implemented for XFree86 at the moment.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/src/kinput.c | 5 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Helper.c | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 20 |
3 files changed, 28 insertions, 0 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 857f04f6d..a9a743ba8 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2374,3 +2374,8 @@ NewInputDeviceRequest(InputOption *options) return Success; } + +void +DeleteInputDeviceRequest(DeviceIntPtr pDev) +{ +} diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 913735bc9..e0b758ffd 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -371,8 +371,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) if (pInp->drv) pInp->drv->refCount--; + /* This should *really* be handled in drv->UnInit(dev) call instead */ +#if 0 if (pInp->private) xfree(pInp->private); +#endif /* Remove the entry from the list. */ if (pInp == xf86InputDevs) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 3800d9a6a..f662c170e 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -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 */ |