diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/hal.c | 9 | ||||
-rw-r--r-- | config/udev.c | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/config/hal.c b/config/hal.c index 1b01eccaa..d3daa84cd 100644 --- a/config/hal.c +++ b/config/hal.c @@ -164,6 +164,7 @@ device_added(LibHalContext *hal_ctx, const char *udi) attrs.product = xstrdup(name); attrs.vendor = get_prop_string(hal_ctx, udi, "info.vendor"); + attrs.tags = xstrtokenize(get_prop_string(hal_ctx, udi, "input.tags"), ","); if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL)) attrs.flags |= ATTR_KEYBOARD; @@ -391,6 +392,14 @@ unwind: xfree(attrs.product); xfree(attrs.vendor); xfree(attrs.device); + if (attrs.tags) { + char **tag = attrs.tags; + while (*tag) { + xfree(*tag); + tag++; + } + xfree(attrs.tags); + } if (xkb_opts.layout) xfree(xkb_opts.layout); diff --git a/config/udev.c b/config/udev.c index 3ef0d7fb3..432ab85e9 100644 --- a/config/udev.c +++ b/config/udev.c @@ -84,6 +84,7 @@ device_added(struct udev_device *udev_device) add_option(&options, "path", path); add_option(&options, "device", path); attrs.device = path; + attrs.tags = xstrtokenize(udev_device_get_property_value(udev_device, "ID_INPUT.tags"), ","); config_info = Xprintf("udev:%s", syspath); if (!config_info) @@ -150,6 +151,15 @@ device_added(struct udev_device *udev_device) xfree(tmpo); } + if (attrs.tags) { + char **tag = attrs.tags; + while (*tag) { + xfree(*tag); + tag++; + } + xfree(attrs.tags); + } + return; } |