diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-23 11:38:08 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-24 14:19:28 +0930 |
commit | 9ab4e2fd8eaa87dbd16835affb1aa54dcb1a619e (patch) | |
tree | 9b981cd2b7ef06fd20c56c33acb00dda34be3e80 /hw/xfree86/common/xf86Xinput.c | |
parent | d09c520b322ba5c5f4d6b630a7c0c62e56732f82 (diff) |
xfree86: don't free the config-file related information in DIDR. #15645
In DeleteInputDeviceRequest, leave the conf_idev (which is shared with
xf86ConfigLayout.input) alone for devices that were specified in the
ServerLayout section of the config file. This way, in the next server
generation we are left with what was the original config and can thus re-init
the devices.
This is an addon to 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae, an attempt to
fix Bug 14418.
X.Org Bug 15645 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
X.Org Bug 14418 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index d34238edc..710e787fd 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -448,6 +448,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; InputDriverPtr drv; IDevRec *idev; + BOOL found; + IDevPtr *it; if (pInfo) /* need to get these before RemoveDevice */ { @@ -464,10 +466,18 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) else xf86DeleteInput(pInfo, 0); - xfree(idev->driver); - xfree(idev->identifier); - xf86optionListFree(idev->commonOptions); - xfree(idev); + /* devices added through HAL aren't in the config layout */ + it = xf86ConfigLayout.inputs; + while(*it && *it != idev) + it++; + + if (!(*it)) /* end of list, not in the layout */ + { + xfree(idev->driver); + xfree(idev->identifier); + xf86optionListFree(idev->commonOptions); + xfree(idev); + } } /* |