summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-07 10:20:52 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-01-08 15:07:03 +1000
commit00341e632c89e14a83a55e3578b8bb2684ce4ae2 (patch)
tree6d3d4fb2572d0839f205dae3200fb3251bd32779
parentf2d2b65343a902c5eedaf50b6f6bcb5ba1ef9c4a (diff)
Drop special XKB option handling
This isn't actually needed at all. xf86nameCompare() will skip over underscores and is case-independent. So xf86SetStrOption("foo_bar") will return an Option "FooBar" and vice versa. The server won't return a zero-length string either, it'll return NULL and spit a warning to the log. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/evdev.c b/src/evdev.c
index c4d12a3..7b355d7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -279,22 +279,6 @@ EvdevRemoveDevice(InputInfoPtr pInfo)
}
}
-
-static void
-SetXkbOption(InputInfoPtr pInfo, const char *name, char **option)
-{
- char *s;
-
- if ((s = xf86SetStrOption(pInfo->options, name, NULL))) {
- if (!s[0]) {
- free(s);
- *option = NULL;
- } else {
- *option = s;
- }
- }
-}
-
static BOOL
EvdevDeviceIsVirtual(const char* devicenode)
{
@@ -1179,19 +1163,11 @@ EvdevAddKeyClass(DeviceIntPtr device)
/* sorry, no rules change allowed for you */
xf86ReplaceStrOption(pInfo->options, "xkb_rules", "evdev");
- SetXkbOption(pInfo, "xkb_rules", &rmlvo.rules);
- SetXkbOption(pInfo, "xkb_model", &rmlvo.model);
- if (!rmlvo.model)
- SetXkbOption(pInfo, "XkbModel", &rmlvo.model);
- SetXkbOption(pInfo, "xkb_layout", &rmlvo.layout);
- if (!rmlvo.layout)
- SetXkbOption(pInfo, "XkbLayout", &rmlvo.layout);
- SetXkbOption(pInfo, "xkb_variant", &rmlvo.variant);
- if (!rmlvo.variant)
- SetXkbOption(pInfo, "XkbVariant", &rmlvo.variant);
- SetXkbOption(pInfo, "xkb_options", &rmlvo.options);
- if (!rmlvo.options)
- SetXkbOption(pInfo, "XkbOptions", &rmlvo.options);
+ rmlvo.rules = xf86SetStrOption(pInfo->options, "xkb_rules", NULL);
+ rmlvo.model = xf86SetStrOption(pInfo->options, "xkb_model", NULL);
+ rmlvo.layout = xf86SetStrOption(pInfo->options, "xkb_layout", NULL);
+ rmlvo.variant = xf86SetStrOption(pInfo->options, "xkb_variant", NULL);
+ rmlvo.options = xf86SetStrOption(pInfo->options, "xkb_options", NULL);
if (!InitKeyboardDeviceStruct(device, &rmlvo, NULL, EvdevKbdCtrl))
rc = !Success;