Allow receiving input events even if the X-server grabbed the device.

SVN-Revision: 22999
This commit is contained in:
Michael Büsch 2010-09-10 21:40:12 +00:00
parent ee81bb7cdb
commit 7751eaf871

View file

@ -0,0 +1,31 @@
---
drivers/input/evdev.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- linux-2.6.35.4.orig/drivers/input/evdev.c
+++ linux-2.6.35.4/drivers/input/evdev.c
@@ -70,7 +70,7 @@ static void evdev_event(struct input_han
unsigned int type, unsigned int code, int value)
{
struct evdev *evdev = handle->private;
- struct evdev_client *client;
+ struct evdev_client *client, *c;
struct input_event event;
do_gettimeofday(&event.time);
@@ -81,9 +81,13 @@ static void evdev_event(struct input_han
rcu_read_lock();
client = rcu_dereference(evdev->grab);
- if (client)
+ if (client) {
evdev_pass_event(client, &event);
- else
+ /* Also pass events to clients that did not grab the device. */
+ list_for_each_entry_rcu(c, &evdev->client_list, node)
+ if (c != client)
+ evdev_pass_event(c, &event);
+ } else
list_for_each_entry_rcu(client, &evdev->client_list, node)
evdev_pass_event(client, &event);