From 0b433e8588dfc9e2e82909f86731003b3516de8b Mon Sep 17 00:00:00 2001 From: ilia Date: Sat, 24 Oct 2009 15:05:30 +0200 Subject: [PATCH] Support filtering of hotplugged input devices. X.Org Bug 24712 Signed-off-by: Ilia K. --- hw/xfree86/common/xf86Xinput.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 6887f55..e5e86d5 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -574,6 +574,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) InputOption *option = NULL; int rval = Success; int is_auto = 0; + char *layout = NULL; idev = xcalloc(sizeof(*idev), 1); if (!idev) @@ -614,6 +615,8 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) goto unwind; } } + if (strcasecmp(option->key, "x11_layout") == 0) + layout = option->value; } if (!idev->driver || !idev->identifier) { xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n"); @@ -626,6 +629,14 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) return BadMatch; } + if (is_auto && layout && strcmp(layout,"*") && strcasecmp(layout, xf86ConfigLayout.id)) { + xf86Msg(X_WARNING,"Device specific x11_layout \"%s\" " + "do not match the current one \"%s\", ignoring\n", + layout, xf86ConfigLayout.id); + return BadMatch; + } + + for (option = options; option; option = option->next) { /* Steal option key/value strings from the provided list. * We need those strings, the InputOption list doesn't. */ -- 1.6.0.4