wayland: Don't cancel a roundtrip when any event is received
authorJonas Ådahl <jadahl@gmail.com>
Tue, 25 Dec 2012 12:01:08 +0000 (13:01 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 3 Jan 2013 16:44:55 +0000 (11:44 -0500)
commit800ed958c33092d694686fcc25c0283dfba86459
tree5ee4cb699b871f26d0c73d8d8ea2a50da3f3254c
parent622d96aae499445f12861214354a5b9f63e3a738
wayland: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/egl/drivers/dri2/platform_wayland.c
src/gallium/state_trackers/egl/wayland/native_wayland.c