client: Fully flush during blocking dispatch
authorJonas Ådahl <jadahl@gmail.com>
Mon, 28 Dec 2015 06:50:12 +0000 (14:50 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 16 Jan 2016 08:37:36 +0000 (16:37 +0800)
commit242617c3161f7d50a592ab21607301aacd4e8f8c
tree82149c584056bbbcdf9ebda6ffe3ac7482209e0a
parent689fff36ca7d2967b4f2724f731df1391df4f337
client: Fully flush during blocking dispatch

wl_display_flush() may fail with EAGAIN which means that not all data
waiting in the buffer has been flushed. We later block until there is
data to read, which could mean that we block on input from the
compositor without having sent out all data from the client. Avoid this
by fully flushing the socket before starting to wait.

This commit also changes the array length of the struct pollfd array
from 2 to 1, as only one element was ever used.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
src/wayland-client.c