<div dir="ltr"><div><div>Guilio,<br></div>Would it be better to name it wl_event_queue_roundtrip and just have it take the wl_event_queue? I guess it is sort-of a wl_display operation, but you could argue it either way. Thoughts?<br>
</div>--Jason Ekstrand<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 7:15 AM, Giulio Camuffo <span dir="ltr"><<a href="mailto:giuliocamuffo@gmail.com" target="_blank">giuliocamuffo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">wl_display_roundtrip() works on the default queue. Add a parallel<br>
wl_display_roundtrip_queue().<br>
---<br>
<br>
</div>v3: fixed dispatch call in place of dispatch_queue<br>
documented the queue parameter<br>
src/wayland-client.c | 24 +++++++++++++++++++++---<br>
src/wayland-client.h | 2 ++<br>
2 files changed, 23 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/wayland-client.c b/src/wayland-client.c<br>
index e8aab7e..d2c1b5c 100644<br>
--- a/src/wayland-client.c<br>
+++ b/src/wayland-client.c<br>
@@ -834,15 +834,16 @@ static const struct wl_callback_listener sync_listener = {<br>
<div class=""> /** Block until all pending request are processed by the server<br>
</div> *<br>
<div class=""> * \param display The display context object<br>
</div>+ * \param queue The queue on which to run the roundtrip<br>
<div class=""> * \return The number of dispatched events on success or -1 on failure<br>
*<br>
* Blocks until the server process all currently issued requests and<br>
- * sends out pending events on all event queues.<br>
+ * sends out pending events on the event queue.<br>
*<br>
* \memberof wl_display<br>
*/<br>
WL_EXPORT int<br>
-wl_display_roundtrip(struct wl_display *display)<br>
+wl_display_roundtrip_queue(struct wl_display *display, struct wl_event_queue *queue)<br>
{<br>
struct wl_callback *callback;<br>
int done, ret = 0;<br>
</div>@@ -851,9 +852,10 @@ wl_display_roundtrip(struct wl_display *display)<br>
<div class=""> callback = wl_display_sync(display);<br>
if (callback == NULL)<br>
return -1;<br>
+ wl_proxy_set_queue(callback, queue);<br>
wl_callback_add_listener(callback, &sync_listener, &done);<br>
while (!done && ret >= 0)<br>
</div>- ret = wl_display_dispatch(display);<br>
+ ret = wl_display_dispatch_queue(display, queue);<br>
<br>
if (ret == -1 && !done)<br>
wl_callback_destroy(callback);<br>
@@ -861,6 +863,22 @@ wl_display_roundtrip(struct wl_display *display)<br>
<div class=""> return ret;<br>
}<br>
<br>
+/** Block until all pending request are processed by the server<br>
+ *<br>
+ * \param display The display context object<br>
+ * \return The number of dispatched events on success or -1 on failure<br>
+ *<br>
+ * Blocks until the server process all currently issued requests and<br>
+ * sends out pending events on the default event queue.<br>
+ *<br>
+ * \memberof wl_display<br>
+ */<br>
+WL_EXPORT int<br>
+wl_display_roundtrip(struct wl_display *display)<br>
+{<br>
</div>+ wl_display_roundtrip_queue(display, &display->default_queue);<br>
<div class="HOEnZb"><div class="h5">+}<br>
+<br>
static int<br>
create_proxies(struct wl_proxy *sender, struct wl_closure *closure)<br>
{<br>
diff --git a/src/wayland-client.h b/src/wayland-client.h<br>
index 2a32785..4377207 100644<br>
--- a/src/wayland-client.h<br>
+++ b/src/wayland-client.h<br>
@@ -163,6 +163,8 @@ int wl_display_dispatch_pending(struct wl_display *display);<br>
int wl_display_get_error(struct wl_display *display);<br>
<br>
int wl_display_flush(struct wl_display *display);<br>
+int wl_display_roundtrip_queue(struct wl_display *display,<br>
+ struct wl_event_queue *queue);<br>
int wl_display_roundtrip(struct wl_display *display);<br>
struct wl_event_queue *wl_display_create_queue(struct wl_display *display);<br>
<br>
--<br>
2.0.1<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br></div>