evdev: Release still pressed keys/buttons when removing device
authorJonas Ådahl <jadahl@gmail.com>
Sun, 27 Jul 2014 14:02:46 +0000 (16:02 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 18 Aug 2014 20:41:16 +0000 (22:41 +0200)
commit8f846a41fa0566fbd72ece676656e20e56ce43e6
tree8cd41c3c112af6efaf82b803e0c234d257f271bb
parent3a3d70a3a895140b91c58bc305c90ee3f9268346
evdev: Release still pressed keys/buttons when removing device

When removing a device, its not guaranteed that all button or key
presses have been released, resulting in an invalid seat wide button
count.

Note that kernel devices normally will send release events when being
unplugged, but this won't happen when removing a device from the path
backend.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev.c
test/keyboard.c
test/pointer.c