if (callback == NULL)
return -1;
wl_callback_add_listener (callback, &sync_listener, &done);
- wl_proxy_set_queue ((struct wl_proxy *) callback, queue);
- while (!done && ret >= 0)
- ret = wl_display_dispatch_queue (display, queue);
+ if (queue) {
+ wl_proxy_set_queue ((struct wl_proxy *) callback, queue);
+ while (!done && ret >= 0)
+ ret = wl_display_dispatch_queue (display, queue);
+ } else {
+ while (!done && ret >= 0)
+ ret = wl_display_dispatch (display);
+ }
if (ret == -1 && !done)
wl_callback_destroy (callback);
WaylandEventSource *source = (WaylandEventSource *) base;
if (source->pfd.revents) {
- wl_display_roundtrip_queue (source->display, source->queue);
+ if (source->queue)
+ wl_display_roundtrip_queue (source->display, source->queue);
+ else
+ wl_display_roundtrip (source->display);
source->pfd.revents = 0;
}