core: Add internal event notification mechanism
authorHans de Goede <hdegoede@redhat.com>
Sun, 28 Sep 2014 11:21:02 +0000 (13:21 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 6 Nov 2014 05:08:28 +0000 (15:08 +1000)
commitad2acca72d501c57a19380f4d73e05c47396f88b
tree8f64a2d6afea3a7f8e7142ab624258330a91f41a
parentd9631dbe215ba2c22279b863976828c25cbfa85d
core: Add internal event notification mechanism

For features like e.g. disable-touchpad-while-typing, it is necessary for one
device to be able to listen into another device's events.

It is tempting to use the existing device_added / device_removed mechanism
to give e.g. the keyboard a link to the touchpad, and make the keyboard code
disable / re-enable the touchpad but this is wrong. This needs to be a setting
of the touchpad, and the policy for things like which events to count as
activity, and what sort of timeout to use to consider the device idle, belongs
in the touchpad code not in the keyboard code.

Add an event listeners mechanism so that the touchpad can listen for (e.g.)
keyboard events, and respond to these itself.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput-private.h
src/libinput.c