xfree86: append, not prepent, new input devices to xf86InputDevs.

If devices are prepended to the list, their wake-up order on resume is not the
same as the original initialisation order. Hot-plugged devices, originally
inited last, are re-enabled before the xorg.conf devices and in some cases may
steal the device files. Result: we have different devices before and after
suspend/resume.

RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386>
(cherry picked from commit 11ee0ae939)
This commit is contained in:
Peter Hutterer 2008-07-14 10:20:11 +09:30
parent 5659f6d31b
commit 5b546f1c49

View File

@ -308,12 +308,11 @@ xf86AllocateScrnInfoPrivateIndex(void)
return idx;
}
/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
_X_EXPORT InputInfoPtr
xf86AllocateInput(InputDriverPtr drv, int flags)
{
InputInfoPtr new;
InputInfoPtr new, *prev = NULL;
if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
return NULL;
@ -321,8 +320,13 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
new->drv = drv;
drv->refCount++;
new->module = DuplicateModule(drv->module, NULL);
new->next = xf86InputDevs;
xf86InputDevs = new;
for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
;
*prev = new;
new->next = NULL;
return new;
}