[PATCH synaptics 2/6] eventcomm: read one more event after finishing a sync

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 8 18:47:13 PDT 2014


Once the sync finishes, we get -EAGAIN. This only indicates the sync is done,
but some events may still be waiting in the pipe for us to read. We must read
those now, otherwise select may not trigger on further data.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/eventcomm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 5030150..0cbbbd0 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -491,8 +491,10 @@ SynapticsReadEvent(InputInfoPtr pInfo, struct input_event *ev)
         if (rc != -EAGAIN) {
             LogMessageVerbSigSafe(X_ERROR, 0, "%s: Read error %d\n", pInfo->name,
                     errno);
-        } else if (proto_data->read_flag == LIBEVDEV_READ_FLAG_SYNC)
+        } else if (proto_data->read_flag == LIBEVDEV_READ_FLAG_SYNC) {
             proto_data->read_flag = LIBEVDEV_READ_FLAG_NORMAL;
+            return SynapticsReadEvent(pInfo, ev);
+        }
 
         return FALSE;
     }
-- 
1.9.0



More information about the xorg-devel mailing list