omap24xx: Add 3.1 patchset.
[openwrt/svn-archive/archive.git] / target / linux / omap24xx / patches-3.1 / 710-evdev-events-without-grab.patch
1 ---
2 drivers/input/evdev.c | 10 +++++++---
3 1 file changed, 7 insertions(+), 3 deletions(-)
4
5 Index: linux-3.1-rc4/drivers/input/evdev.c
6 ===================================================================
7 --- linux-3.1-rc4.orig/drivers/input/evdev.c 2011-08-29 06:16:01.000000000 +0200
8 +++ linux-3.1-rc4/drivers/input/evdev.c 2011-10-27 16:47:54.773182635 +0200
9 @@ -92,7 +92,7 @@ static void evdev_event(struct input_han
10 unsigned int type, unsigned int code, int value)
11 {
12 struct evdev *evdev = handle->private;
13 - struct evdev_client *client;
14 + struct evdev_client *client, *c;
15 struct input_event event;
16
17 do_gettimeofday(&event.time);
18 @@ -103,9 +103,13 @@ static void evdev_event(struct input_han
19 rcu_read_lock();
20
21 client = rcu_dereference(evdev->grab);
22 - if (client)
23 + if (client) {
24 evdev_pass_event(client, &event);
25 - else
26 + /* Also pass events to clients that did not grab the device. */
27 + list_for_each_entry_rcu(c, &evdev->client_list, node)
28 + if (c != client)
29 + evdev_pass_event(c, &event);
30 + } else
31 list_for_each_entry_rcu(client, &evdev->client_list, node)
32 evdev_pass_event(client, &event);
33