|
|
982c1d5 |
From e654ed62d44b8d61484f97eab1b1adbfb08d375f Mon Sep 17 00:00:00 2001
|
|
|
982c1d5 |
From: Dave Airlie <airlied@redhat.com>
|
|
|
982c1d5 |
Date: Thu, 12 Jun 2008 11:52:29 +1000
|
|
|
982c1d5 |
Subject: [PATCH] config: disable evdev for keyboards
|
|
|
0414809 |
|
|
|
0414809 |
---
|
|
|
982c1d5 |
config/hal.c | 28 ++++++++++++++++++++++++++++
|
|
|
982c1d5 |
1 files changed, 28 insertions(+), 0 deletions(-)
|
|
|
0414809 |
|
|
|
0414809 |
diff --git a/config/hal.c b/config/hal.c
|
|
|
982c1d5 |
index f4eb438..ee0f18f 100644
|
|
|
0414809 |
--- a/config/hal.c
|
|
|
0414809 |
+++ b/config/hal.c
|
|
|
982c1d5 |
@@ -168,6 +168,31 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
|
|
|
982c1d5 |
}
|
|
|
982c1d5 |
#endif
|
|
|
982c1d5 |
|
|
|
982c1d5 |
+static Bool
|
|
|
982c1d5 |
+get_device_is_keyboard(LibHalContext *hal_ctx, const char *udi, DBusError *error_p)
|
|
|
982c1d5 |
+{
|
|
|
982c1d5 |
+ char **props;
|
|
|
982c1d5 |
+ int i;
|
|
|
982c1d5 |
+ Bool ret = FALSE;
|
|
|
982c1d5 |
+
|
|
|
982c1d5 |
+ props = libhal_device_get_property_strlist(hal_ctx, udi,
|
|
|
982c1d5 |
+ "info.capabilities", error_p);
|
|
|
982c1d5 |
+ if (!props) {
|
|
|
982c1d5 |
+ return FALSE;
|
|
|
982c1d5 |
+ }
|
|
|
cd76076 |
+ for (i = 0; props[i]; i++) {
|
|
|
982c1d5 |
+ if (strcmp(props[i], "input.keys") == 0 ||
|
|
|
982c1d5 |
+ strcmp(props[i], "input.keyboard") == 0) {
|
|
|
982c1d5 |
+ ret = TRUE;
|
|
|
982c1d5 |
+ goto out_error;
|
|
|
982c1d5 |
+ }
|
|
|
cd76076 |
+ }
|
|
|
982c1d5 |
+
|
|
|
982c1d5 |
+out_error:
|
|
|
982c1d5 |
+ libhal_free_string_array(props);
|
|
|
982c1d5 |
+ return ret;
|
|
|
982c1d5 |
+}
|
|
|
982c1d5 |
+
|
|
|
982c1d5 |
static void
|
|
|
982c1d5 |
device_added(LibHalContext *hal_ctx, const char *udi)
|
|
|
982c1d5 |
{
|
|
|
982c1d5 |
@@ -184,6 +209,9 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
|
|
982c1d5 |
|
|
|
982c1d5 |
dbus_error_init(&error);
|
|
|
cd76076 |
|
|
|
982c1d5 |
+ if (get_device_is_keyboard(hal_ctx, udi, &error))
|
|
|
982c1d5 |
+ goto unwind;
|
|
|
982c1d5 |
+
|
|
|
982c1d5 |
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
|
|
|
982c1d5 |
if (!driver){
|
|
|
982c1d5 |
/* verbose, don't tell the user unless they _want_ to see it */
|
|
|
0414809 |
--
|
|
|
982c1d5 |
1.5.3.7
|
|
|
0414809 |
|