dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418)
The DDX (xfree86 anyway) maintains its own device list in addition to the one in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the server then restarts (last client disconnects), the DDX devices are still there, will be re-initialised, then the hal devices come in and are added too. This repeats until we run out of device ids. This also requires us to strdup() the default pointer/keyboard in checkCoreInputDevices. X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418>
This commit is contained in:
parent
3c337e18b9
commit
6d22a9615a
|
@ -618,12 +618,12 @@ CloseDownDevices(void)
|
||||||
for (dev = inputInfo.devices; dev; dev = next)
|
for (dev = inputInfo.devices; dev; dev = next)
|
||||||
{
|
{
|
||||||
next = dev->next;
|
next = dev->next;
|
||||||
CloseDevice(dev);
|
DeleteInputDeviceRequest(dev);
|
||||||
}
|
}
|
||||||
for (dev = inputInfo.off_devices; dev; dev = next)
|
for (dev = inputInfo.off_devices; dev; dev = next)
|
||||||
{
|
{
|
||||||
next = dev->next;
|
next = dev->next;
|
||||||
CloseDevice(dev);
|
DeleteInputDeviceRequest(dev);
|
||||||
}
|
}
|
||||||
inputInfo.devices = NULL;
|
inputInfo.devices = NULL;
|
||||||
inputInfo.off_devices = NULL;
|
inputInfo.off_devices = NULL;
|
||||||
|
|
|
@ -1338,8 +1338,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
/* 5. Built-in default. */
|
/* 5. Built-in default. */
|
||||||
if (!foundPointer) {
|
if (!foundPointer) {
|
||||||
bzero(&defPtr, sizeof(defPtr));
|
bzero(&defPtr, sizeof(defPtr));
|
||||||
defPtr.inp_identifier = "<default pointer>";
|
defPtr.inp_identifier = strdup("<default pointer>");
|
||||||
defPtr.inp_driver = "mouse";
|
defPtr.inp_driver = strdup("mouse");
|
||||||
confInput = &defPtr;
|
confInput = &defPtr;
|
||||||
foundPointer = TRUE;
|
foundPointer = TRUE;
|
||||||
from = X_DEFAULT;
|
from = X_DEFAULT;
|
||||||
|
@ -1385,8 +1385,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
if (!found) {
|
if (!found) {
|
||||||
xf86Msg(X_INFO, "No default mouse found, adding one\n");
|
xf86Msg(X_INFO, "No default mouse found, adding one\n");
|
||||||
bzero(&defPtr, sizeof(defPtr));
|
bzero(&defPtr, sizeof(defPtr));
|
||||||
defPtr.inp_identifier = "<default pointer>";
|
defPtr.inp_identifier = strdup("<default pointer>");
|
||||||
defPtr.inp_driver = "mouse";
|
defPtr.inp_driver = strdup("mouse");
|
||||||
confInput = &defPtr;
|
confInput = &defPtr;
|
||||||
foundPointer = configInput(&Pointer, confInput, from);
|
foundPointer = configInput(&Pointer, confInput, from);
|
||||||
if (foundPointer) {
|
if (foundPointer) {
|
||||||
|
@ -1474,8 +1474,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
/* 5. Built-in default. */
|
/* 5. Built-in default. */
|
||||||
if (!foundKeyboard) {
|
if (!foundKeyboard) {
|
||||||
bzero(&defKbd, sizeof(defKbd));
|
bzero(&defKbd, sizeof(defKbd));
|
||||||
defKbd.inp_identifier = "<default keyboard>";
|
defKbd.inp_identifier = strdup("<default keyboard>");
|
||||||
defKbd.inp_driver = "kbd";
|
defKbd.inp_driver = strdup("kbd");
|
||||||
confInput = &defKbd;
|
confInput = &defKbd;
|
||||||
foundKeyboard = TRUE;
|
foundKeyboard = TRUE;
|
||||||
keyboardMsg = "default keyboard configuration";
|
keyboardMsg = "default keyboard configuration";
|
||||||
|
|
|
@ -446,11 +446,19 @@ void
|
||||||
DeleteInputDeviceRequest(DeviceIntPtr pDev)
|
DeleteInputDeviceRequest(DeviceIntPtr pDev)
|
||||||
{
|
{
|
||||||
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
|
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
|
||||||
InputDriverPtr drv = pInfo->drv;
|
InputDriverPtr drv;
|
||||||
IDevRec *idev = pInfo->conf_idev;
|
IDevRec *idev;
|
||||||
|
|
||||||
|
if (pInfo) /* need to get these before RemoveDevice */
|
||||||
|
{
|
||||||
|
drv = pInfo->drv;
|
||||||
|
idev = pInfo->conf_idev;
|
||||||
|
}
|
||||||
RemoveDevice(pDev);
|
RemoveDevice(pDev);
|
||||||
|
|
||||||
|
if (!pInfo) /* VCP and VCK */
|
||||||
|
return;
|
||||||
|
|
||||||
if(drv->UnInit)
|
if(drv->UnInit)
|
||||||
drv->UnInit(drv, pInfo, 0);
|
drv->UnInit(drv, pInfo, 0);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user