[PATCH mouse v2] Use pInfo->options instead of conf-idev.
Peter Hutterer
peter.hutterer at who-t.net
Wed Nov 17 19:38:46 PST 2010
Because it doesn't really matter anyway, I think.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
---
Stumbled across a bug before pushing when running against pre ABI 12.
Changes to v1:
- see xf86CollectInputOptions() handling in the src/mouse.c hunk
Chase, I left your Reviewed-by tag in there since it's the same patch except
for that line.
src/bsd_mouse.c | 8 ++++----
src/hurd_mouse.c | 4 ++--
src/lnx_mouse.c | 6 +++---
src/mouse.c | 6 +++++-
src/sun_mouse.c | 20 +++++++++-----------
5 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index e288f38..94d4382 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -329,8 +329,8 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
if (dev) {
/* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", dev);
+ pInfo->options =
+ xf86AddNewOption(pInfo->options, "Device", dev);
xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
pInfo->name, dev);
}
@@ -369,8 +369,8 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
SYSCALL(fd = open(*pdev, O_RDWR | O_NONBLOCK));
if (fd != -1) {
/* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions,
+ pInfo->options =
+ xf86AddNewOption(pInfo->options,
"Device", *pdev);
xf86Msg(X_INFO, "%s: found Device \"%s\"\n",
pInfo->name, *pdev);
diff --git a/src/hurd_mouse.c b/src/hurd_mouse.c
index 45b3cf2..e0ed126 100644
--- a/src/hurd_mouse.c
+++ b/src/hurd_mouse.c
@@ -183,8 +183,8 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
return NULL;
close(fd);
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", path);
+ pInfo->options =
+ xf86AddNewOption(pInfo->options, "Device", path);
xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", pInfo->name,
path);
diff --git a/src/lnx_mouse.c b/src/lnx_mouse.c
index 914b941..32b83b7 100644
--- a/src/lnx_mouse.c
+++ b/src/lnx_mouse.c
@@ -80,8 +80,8 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
if (*pdev) {
close(fd);
/* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", *pdev);
+ pInfo->options =
+ xf86AddNewOption(pInfo->options, "Device", *pdev);
xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
pInfo->name, *pdev);
}
@@ -99,7 +99,7 @@ lnxMouseMagic(InputInfoPtr pInfo)
int i;
int proto = MOUSE_PROTO_UNKNOWN;
- dev = xf86SetStrOption(pInfo->conf_idev->commonOptions, "Device", NULL);
+ dev = xf86SetStrOption(pInfo->options, "Device", NULL);
if (!dev) {
#ifdef DEBUG
ErrorF("xf86SetStrOption failed to return the device name\n");
diff --git a/src/mouse.c b/src/mouse.c
index fb9ccc8..e600474 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -923,7 +923,11 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
pMse->autoProbe = FALSE;
/* Collect the options, and process the common options. */
- xf86CollectInputOptions(pInfo, pProto->defaults, NULL);
+ /* need some special handling here. xf86CollectInputOptions will reset
+ * pInfo->options if the second argument is not-null. To re-merge the
+ * previously set arguments, pass the original pInfo->options in.
+ */
+ xf86CollectInputOptions(pInfo, pProto->defaults, pInfo->options);
xf86ProcessCommonOptions(pInfo, pInfo->options);
/* Check if the device can be opened. */
diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 4749f88..95b45bc 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -259,8 +259,8 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
if (buttons == 0) {
SYSCALL(i = ioctl(pInfo->fd, MSIOBUTTONS, &buttons));
if (i == 0) {
- pInfo->conf_idev->commonOptions =
- xf86ReplaceIntOption(pInfo->conf_idev->commonOptions,
+ pInfo->options =
+ xf86ReplaceIntOption(pInfo->options,
"Buttons", buttons);
xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n",
pInfo->name, buttons);
@@ -676,16 +676,14 @@ solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
/* Check to see if xorg.conf or HAL specified a device to use */
*device = xf86CheckStrOption(pInfo->options, "Device", NULL);
if (*device == NULL) {
- *device = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
- "Device", NULL);
+ *device = xf86CheckStrOption(pInfo->options, "Device", NULL);
}
}
if (*device != NULL) {
strmod = xf86CheckStrOption(pInfo->options, "StreamsModule", NULL);
if (strmod == NULL) {
- strmod = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
- "StreamsModule", NULL);
+ strmod = xf86CheckStrOption(pInfo->options, "StreamsModule", NULL);
}
if (strmod) {
/* if a device name is already known, and a StreamsModule is
@@ -744,13 +742,13 @@ SetupAuto(InputInfoPtr pInfo, int *protoPara)
/* probe to find device/protocol to use */
if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
/* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ pInfo->options =
+ xf86AddNewOption(pInfo->options, "Device", pdev);
xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
pInfo->name, pdev);
}
} else if (pMse->protocolID == PROT_AUTO) {
- pdev = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
+ pdev = xf86CheckStrOption(pInfo->options,
"Device", NULL);
solarisMouseAutoProbe(pInfo, &pproto, &pdev);
}
@@ -765,8 +763,8 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
/* Set the Device option. */
- pInfo->conf_idev->commonOptions =
- xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ pInfo->options =
+ xf86AddNewOption(pInfo->options, "Device", pdev);
xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
pInfo->name, pdev);
}
--
1.7.3.2
More information about the xorg-devel
mailing list