diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index bde80eacd..d4b935157 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -330,6 +330,8 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) if (pInp->private) free(pInp->private); + FreeInputAttributes(pInp->attrs); + /* Remove the entry from the list. */ if (pInp == xf86InputDevs) xf86InputDevs = pInp->next; diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index 8be893cc3..61d0dcc2e 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -164,6 +164,10 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, else pInfo->options = tmp; } + + if (pInfo->conf_idev && pInfo->conf_idev->attrs) { + pInfo->attrs = pInfo->conf_idev->attrs; + } } /* Created for new XInput stuff -- essentially extensions to the parser */ diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 2e254821e..356ddab4c 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -622,7 +622,6 @@ MergeInputClasses(IDevPtr idev, InputAttributes *attrs) mergedopts = xf86ReplaceStrOption(mergedopts, "driver", idev->driver); } idev->commonOptions = xf86optionListMerge(idev->commonOptions, mergedopts); - return Success; } @@ -822,6 +821,8 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, rval = MergeInputClasses(idev, attrs); if (rval != Success) goto unwind; + + idev->attrs = DuplicateInputAttributes(attrs); } if (!idev->driver || !idev->identifier) { diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index aa9e9d507..20a3f1bab 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -148,6 +148,7 @@ typedef struct _LocalDeviceRec { pointer module; pointer options; unsigned int history_size; + InputAttributes *attrs; } LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr; typedef struct _DeviceAssocRec diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 22f0261b4..c9b261d66 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -406,6 +406,7 @@ typedef struct { char * driver; pointer commonOptions; pointer extraOptions; + InputAttributes *attrs; } IDevRec, *IDevPtr; typedef struct {