summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xi/stubs.c12
-rw-r--r--config/config.c2
-rw-r--r--hw/kdrive/src/kinput.c5
-rw-r--r--hw/xfree86/common/xf86Helper.c3
-rw-r--r--hw/xfree86/common/xf86Xinput.c20
-rw-r--r--include/input.h2
6 files changed, 43 insertions, 1 deletions
diff --git a/Xi/stubs.c b/Xi/stubs.c
index ed041b815..d425fe9d4 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -230,3 +230,15 @@ NewInputDeviceRequest(InputOption *options)
{
return BadValue;
}
+
+/****************************************************************************
+ *
+ * Caller: configRemoveDevice (and others)
+ *
+ * Remove the specified device previously added.
+ *
+ */
+void
+DeleteInputDeviceRequest(DeviceIntPtr dev)
+{
+}
diff --git a/config/config.c b/config/config.c
index d72b588dc..b8d24289b 100644
--- a/config/config.c
+++ b/config/config.c
@@ -212,7 +212,7 @@ configRemoveDevice(DBusMessage *message, DBusMessageIter *iter,
* already been removed. */
OsBlockSignals();
ProcessInputEvents();
- RemoveDevice(pDev);
+ DeleteInputDeviceRequest(pDev);
OsReleaseSignals();
return Success;
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
*/
diff --git a/include/input.h b/include/input.h
index fc607d35b..1e657099c 100644
--- a/include/input.h
+++ b/include/input.h
@@ -446,6 +446,8 @@ extern DeviceIntPtr LookupDeviceIntRec(
/* Implemented by the DDX. */
extern int NewInputDeviceRequest(
InputOption *options);
+extern void DeleteInputDeviceRequest(
+ DeviceIntPtr dev);
extern void DDXRingBell(
int volume,