[xserver: PATCH] config/udev: allow passing arbitrary configuration via 'ENV{x11_options.$opt}'

Sergei Trofimovich slyfox at gentoo.org
Sun Jun 17 15:14:00 PDT 2012


It is convenient to play with mouse/touchpad changes at runtime.

    ENV{ID_INPUT_MOUSE}=="?*", ENV{x11_options.Emulate3Buttons}="True"
    # replug the revice to see immediate effect

and consistent with hal's configuration scheme.

Original-patch: http://lists.debian.org/debian-x/2010/04/msg00320.html
Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
---
 config/udev.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index 1995184..35f682f 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -37,6 +37,8 @@
 #include "os.h"
 #include "globals.h"
 
+
+#define UDEV_X11_PROP_KEY "x11_options."
 #define UDEV_XKB_PROP_KEY "xkb"
 
 #define LOG_PROPERTY(path, prop, val)                                   \
@@ -173,6 +175,10 @@ device_added(struct udev_device *udev_device)
             else if (!strcasecmp(tmp, "options"))
                 input_options =
                     input_option_new(input_options, "xkb_options", value);
+        } else if (!strncasecmp(key, UDEV_X11_PROP_KEY, sizeof(UDEV_X11_PROP_KEY) - 1)) {
+            tmp = key + sizeof(UDEV_X11_PROP_KEY) - 1;
+            input_options =
+                input_option_new(input_options, tmp, value);
         }
         else if (!strcmp(key, "ID_VENDOR")) {
             LOG_PROPERTY(path, key, value);
-- 
1.7.8.6



More information about the xorg-devel mailing list