evdev: fix input lag when processing input from output repaint
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 20 Mar 2012 23:52:57 +0000 (19:52 -0400)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:27 +0000 (17:51 +0100)
commit8046633edf176435f127a82ea14bfe369cdeef8b
tree00d9fb2133f0a2f72a0a8f7bc82349c5f40f3eae
parentbdb628857bb9b7705838b83a230c14c12411f15b
evdev: fix input lag when processing input from output repaint

When the compositor is in a repaint cycle, input is processed only once
per frame. However, a call to evdev_input_device_data() would handle at
most 8 events at time. When there was more than 8 events pending for a
given frame, input lag would occur. This was most visible with multi
touch input.

This patch changes the evdev_input_device_data() so that it will handle
all the events available in the fd. In order to do that, the fd is put
in non-blocking mode, so that it is possible to loop on read and stop
on EAGAIN instead of blocking.
src/evdev.c