Contents of /trunk/xorg-server/patches/xorg-server-1.4.99.906-no-evdev-keyboards.patch
Parent Directory | Revision Log
Revision 672 -
(show annotations)
(download)
Sun Aug 24 13:46:34 2008 UTC (16 years, 1 month ago) by niro
File size: 1505 byte(s)
Sun Aug 24 13:46:34 2008 UTC (16 years, 1 month ago) by niro
File size: 1505 byte(s)
-evdev patch for xorg-1.4.99.906
1 | From e654ed62d44b8d61484f97eab1b1adbfb08d375f Mon Sep 17 00:00:00 2001 |
2 | From: Dave Airlie <airlied@redhat.com> |
3 | Date: Thu, 12 Jun 2008 11:52:29 +1000 |
4 | Subject: [PATCH] config: disable evdev for keyboards |
5 | |
6 | --- |
7 | config/hal.c | 28 ++++++++++++++++++++++++++++ |
8 | 1 files changed, 28 insertions(+), 0 deletions(-) |
9 | |
10 | diff --git a/config/hal.c b/config/hal.c |
11 | index f4eb438..ee0f18f 100644 |
12 | --- a/config/hal.c |
13 | +++ b/config/hal.c |
14 | @@ -168,6 +168,31 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop) |
15 | } |
16 | #endif |
17 | |
18 | +static Bool |
19 | +get_device_is_keyboard(LibHalContext *hal_ctx, const char *udi, DBusError *error_p) |
20 | +{ |
21 | + char **props; |
22 | + int i; |
23 | + Bool ret = FALSE; |
24 | + |
25 | + props = libhal_device_get_property_strlist(hal_ctx, udi, |
26 | + "info.capabilities", error_p); |
27 | + if (!props) { |
28 | + return FALSE; |
29 | + } |
30 | + for (i = 0; props[i]; i++) { |
31 | + if (strcmp(props[i], "input.keys") == 0 || |
32 | + strcmp(props[i], "input.keyboard") == 0) { |
33 | + ret = TRUE; |
34 | + goto out_error; |
35 | + } |
36 | + } |
37 | + |
38 | +out_error: |
39 | + libhal_free_string_array(props); |
40 | + return ret; |
41 | +} |
42 | + |
43 | static void |
44 | device_added(LibHalContext *hal_ctx, const char *udi) |
45 | { |
46 | @@ -184,6 +209,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) |
47 | |
48 | dbus_error_init(&error); |
49 | |
50 | + if (get_device_is_keyboard(hal_ctx, udi, &error)) |
51 | + goto unwind; |
52 | + |
53 | driver = get_prop_string(hal_ctx, udi, "input.x11_driver"); |
54 | if (!driver){ |
55 | /* verbose, don't tell the user unless they _want_ to see it */ |
56 | -- |
57 | 1.5.3.7 |
58 |