window: use roundtrip instead of dispatch after get_registry
authorMarek Chalupa <mchqwerty@gmail.com>
Fri, 5 Dec 2014 12:49:40 +0000 (13:49 +0100)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 12 Dec 2014 11:57:05 +0000 (13:57 +0200)
wl_display_dispatch() just dispatches events that are in
default and display queues and if there are no events,
then it will wait for them. But only dispatching
the events doesn't guarantee that we got all the global announcements,
we need to do sync too. Therefore use wl_display_roundtrip() instead
of wl_display_dispatch().

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
clients/window.c

index cc1e272..c5082ba 100644 (file)
@@ -5527,7 +5527,7 @@ display_create(int *argc, char *argv[])
        d->registry = wl_display_get_registry(d->display);
        wl_registry_add_listener(d->registry, &registry_listener, d);
 
-       if (wl_display_dispatch(d->display) < 0) {
+       if (wl_display_roundtrip(d->display) < 0) {
                fprintf(stderr, "Failed to process Wayland connection: %m\n");
                return NULL;
        }