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 <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Marek Chalupa 2015-03-19 03:35:40 -04:00 committed by Pekka Paalanen
parent 70ac0edcab
commit a413ff897d
1 changed files with 4 additions and 2 deletions

View File

@ -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, &registry_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 */