diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2008-07-29 12:59:57 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-08-04 15:14:05 +0930 |
commit | 35b14519b4a3158592a089170ec039bbc219603e (patch) | |
tree | b8e05ce51e5477bc8f673a7ab700588b6ce65450 /config | |
parent | d762c08aebe3b7e8c88e2e7a6fcf66057a21b403 (diff) |
config: add parsing for input.x11_options.XkbOptions. #16874
X.Org Bug 16874 <http://bugs.freedesktop.org/show_bug.cgi?id=16784>
Diffstat (limited to 'config')
-rw-r--r-- | config/hal.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config/hal.c b/config/hal.c index b6d7402a6..a9451b74e 100644 --- a/config/hal.c +++ b/config/hal.c @@ -1,5 +1,6 @@ /* * Copyright © 2007 Daniel Stone + * Copyright © 2007 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -54,6 +55,7 @@ struct xkb_options { char* model; char* rules; char* variant; + char* options; }; @@ -284,6 +286,11 @@ device_added(LibHalContext *hal_ctx, const char *udi) if (xkb_opts.variant) xfree(xkb_opts.variant); xkb_opts.variant = strdup(tmp_val); + } else if (!strcasecmp(&tmp[3], "options")) + { + if (xkb_opts.options) + xfree(xkb_opts.options); + xkb_opts.options = strdup(tmp_val); } } else { @@ -318,6 +325,10 @@ device_added(LibHalContext *hal_ctx, const char *udi) { if (!xkb_opts.model) xkb_opts.model = strdup(tmp_val); + } else if (!strcasecmp(tmp, "options")) + { + if (!xkb_opts.options) + xkb_opts.options = strdup(tmp_val); } xfree(tmp_val); } @@ -338,6 +349,8 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(&options, "xkb_variant", xkb_opts.variant); if (xkb_opts.model) add_option(&options, "xkb_model", xkb_opts.model); + if (xkb_opts.options) + add_option(&options, "xkb_options", xkb_opts.options); /* this isn't an error, but how else do you output something that the user can see? */ LogMessage(X_INFO, "config/hal: Adding input device %s\n", name); @@ -379,6 +392,8 @@ unwind: xfree(xkb_opts.model); if (xkb_opts.variant) xfree(xkb_opts.variant); + if (xkb_opts.options) + xfree(xkb_opts.options); dbus_error_free(&error); |