From e4f53b85d109f31e0cae74c9e59e2374e0282586 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Jul 2008 12:59:57 +0930 Subject: [PATCH] config: add parsing for input.x11_options.XkbOptions. #16874 X.Org Bug 16874 --- config/hal.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/config/hal.c b/config/hal.c index b6d7402..c67b5a7 100644 --- a/config/hal.c +++ b/config/hal.c @@ -54,6 +54,7 @@ struct xkb_options { char* model; char* rules; char* variant; + char* options; }; @@ -284,6 +285,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 +324,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 +348,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 +391,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); -- 1.5.4.3