aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZephaniah E. Hull <warp@agamemnon.b5>2007-06-12 11:59:16 -0400
committerZephaniah E. Hull <warp@agamemnon.b5>2007-06-12 11:59:16 -0400
commit9c9a47210a6c7146f29fd6d05b6f46955a3bee5a (patch)
tree8d08d99e6bbf9a8f5a6622d81b6373e1bb0ec239
parentevdev.c: (diff)
downloadxf86-input-evdev-9c9a47210a6c7146f29fd6d05b6f46955a3bee5a.tar.gz
xf86-input-evdev-9c9a47210a6c7146f29fd6d05b6f46955a3bee5a.tar.bz2
xf86-input-evdev-9c9a47210a6c7146f29fd6d05b6f46955a3bee5a.zip
Move the mode option handling to the Init stage.
(Sorta ugly placement wise, but the other segfaults.)
-rw-r--r--src/evdev_axes.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/evdev_axes.c b/src/evdev_axes.c
index 60bfde7..e967c61 100644
--- a/src/evdev_axes.c
+++ b/src/evdev_axes.c
@@ -726,18 +726,6 @@ EvdevAxisAbsNew1(InputInfoPtr pInfo)
}
}
- s = xf86SetStrOption(pInfo->options, "Mode", "Absolute");
- if (!strcasecmp(s, "Absolute")) {
- pInfo->dev->valuator->mode = Absolute;
- xf86Msg(X_CONFIG, "%s: Configuring in %s mode.\n", pInfo->name, s);
- } else if (!strcasecmp(s, "Relative")) {
- pInfo->dev->valuator->mode = Relative;
- xf86Msg(X_CONFIG, "%s: Configuring in %s mode.\n", pInfo->name, s);
- } else {
- pInfo->dev->valuator->mode = Absolute;
- xf86Msg(X_CONFIG, "%s: Unknown Mode: %s.\n", pInfo->name, s);
- }
-
return Success;
}
@@ -861,6 +849,7 @@ EvdevAxesInit (DeviceIntPtr device)
evdevAxesRec *axes = state->axes;
AbsoluteClassRec *dev_abs;
int i;
+ const char *s;
if (!axes || !axes->axes)
return Success;
@@ -874,6 +863,23 @@ EvdevAxesInit (DeviceIntPtr device)
0))
return !Success;
+
+ /*
+ * This has to go in Init, because until now there is no valuator struct
+ * allocated.
+ */
+ s = xf86SetStrOption(pInfo->options, "Mode", "Absolute");
+ if (!strcasecmp(s, "Absolute")) {
+ pInfo->dev->valuator->mode = Absolute;
+ xf86Msg(X_CONFIG, "%s: Configuring in %s mode.\n", pInfo->name, s);
+ } else if (!strcasecmp(s, "Relative")) {
+ pInfo->dev->valuator->mode = Relative;
+ xf86Msg(X_CONFIG, "%s: Configuring in %s mode.\n", pInfo->name, s);
+ } else {
+ pInfo->dev->valuator->mode = Absolute;
+ xf86Msg(X_CONFIG, "%s: Unknown Mode: %s.\n", pInfo->name, s);
+ }
+
/*
* Yes, we want to do this for relative devices too.
* Some of the settings are useful for both.