From a413ff897da561abfb6986dd9a8ab9bf5238ee50 Mon Sep 17 00:00:00 2001 From: Marek Chalupa Date: Thu, 19 Mar 2015 03:35:40 -0400 Subject: [PATCH] tests: use two roundtrips for global events first is for getting and binding to globals and the other one is for getting wl_shm.formats that are emitted after binding to wl_shm Signed-off-by: Marek Chalupa Reviewed-by: Daniel Stone Reviewed-by: Pekka Paalanen --- tests/weston-test-client-helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c index fa11bc15..cf9e7429 100644 --- a/tests/weston-test-client-helper.c +++ b/tests/weston-test-client-helper.c @@ -579,8 +579,10 @@ client_create(int x, int y, int width, int height) client->wl_registry = wl_display_get_registry(client->wl_display); wl_registry_add_listener(client->wl_registry, ®istry_listener, client); - /* trigger global listener */ - wl_display_dispatch(client->wl_display); + /* trigger global listener. Need to dispatch two times, because wl_shm + * will emit new events after binding and we need them to arrive + * before continuing */ + wl_display_roundtrip(client->wl_display); wl_display_roundtrip(client->wl_display); /* must have WL_SHM_FORMAT_ARGB32 */