neuwld

patched neuwld library (tracked)
git clone https://git.daat.foo/neuwld.git
Log | Files | Refs | README | LICENSE

commit 7fe3933898d156324e2836726617355649e53ed9
parent 3700d030de3b6a6a1304003ae2e436a77e28d275
Author: Michael Forney <mforney@mforney.org>
Date:   Sat, 18 Oct 2014 13:36:09 -0700

wayland: Use wl_display_roundtrip_queue

Diffstat:
Mwayland-drm.c | 6+++---
Mwayland-private.h | 6------
Mwayland-shm.c | 4++--
Mwayland.c | 20--------------------
4 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/wayland-drm.c b/wayland-drm.c @@ -104,7 +104,7 @@ struct wld_context * wld_wayland_drm_create_context(struct wl_display * display, wl_proxy_set_queue((struct wl_proxy *) context->registry, queue); /* Wait for wl_drm global. */ - wayland_roundtrip(display, queue); + wl_display_roundtrip_queue(display, queue); if (!context->wl) { @@ -115,7 +115,7 @@ struct wld_context * wld_wayland_drm_create_context(struct wl_display * display, wl_drm_add_listener(context->wl, &drm_listener, context); /* Wait for DRM capabilities and device. */ - wayland_roundtrip(display, queue); + wl_display_roundtrip_queue(display, queue); if (!(context->capabilities & WL_DRM_CAPABILITY_PRIME)) { @@ -130,7 +130,7 @@ struct wld_context * wld_wayland_drm_create_context(struct wl_display * display, } /* Wait for DRM authentication. */ - wayland_roundtrip(display, queue); + wl_display_roundtrip_queue(display, queue); if (!context->authenticated) { diff --git a/wayland-private.h b/wayland-private.h @@ -52,12 +52,6 @@ extern const struct wld_wayland_interface wayland_drm_interface; extern const struct wld_wayland_interface wayland_shm_interface; #endif -/** - * Like wl_display_roundtrip, but for a particular event queue. - */ -int wayland_roundtrip(struct wl_display * display, - struct wl_event_queue * queue); - bool wayland_buffer_add_exporter(struct buffer * buffer, struct wl_buffer * wl); #endif diff --git a/wayland-shm.c b/wayland-shm.c @@ -114,7 +114,7 @@ struct wld_context * wld_wayland_shm_create_context wl_proxy_set_queue((struct wl_proxy *) context->registry, queue); /* Wait for wl_shm global. */ - wayland_roundtrip(display, queue); + wl_display_roundtrip_queue(display, queue); if (!context->wl) { @@ -125,7 +125,7 @@ struct wld_context * wld_wayland_shm_create_context wl_shm_add_listener(context->wl, &shm_listener, context); /* Wait for SHM formats. */ - wayland_roundtrip(display, queue); + wl_display_roundtrip_queue(display, queue); return &context->base.base; diff --git a/wayland.c b/wayland.c @@ -183,26 +183,6 @@ struct wld_surface * wld_wayland_create_surface(struct wld_context * context, return NULL; } -int wayland_roundtrip(struct wl_display * display, - struct wl_event_queue * queue) -{ - struct wl_callback * callback; - bool done = false; - int ret = 0; - - callback = wl_display_sync(display); - 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 (ret == -1 && !done) - wl_callback_destroy(callback); - - return ret; -} - static bool buffer_export(struct wld_exporter * exporter, struct wld_buffer * buffer, uint32_t type, union wld_object * object)