mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Move the mode option handling to the Init stage.
(Sorta ugly placement wise, but the other segfaults.)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user