From 0737f7a60f9274bdd17b3f4798f59d9b45047357 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 13 Jul 2016 09:50:43 +0900 Subject: [PATCH] Added codes about processing for event_queue of wl_tbm_queue. Change-Id: I687624549548c405a2325e68072991a21b7e6a54 Signed-off-by: joonbum.ko --- src/tpl_wayland_egl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 9606dd8..dde27fe 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -725,6 +725,20 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface) wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, queue); } + /* wayland_egl_surface->wl_proxy has to receive below wayland events. + * - buffer_attached_with_id + * - buffer_attached_with_fd + * - active + * - deactive + * + * When wayland_egl_surface->wl_proxy( == wl_tbm_queue ) could not receive + * any events, tpl_surface cannot get a buffer. + * So, we have to manage event queue about wl_tbm_queue along with wl_buffer. + */ + + if (wayland_egl_surface->wl_proxy) + wl_proxy_set_queue(wayland_egl_surface->wl_proxy, queue); + wl_display_dispatch_pending((struct wl_display *)surface->display->native_handle); if (tbm_surface_queue_can_dequeue(wayland_egl_surface->tbm_queue, 0)) @@ -735,6 +749,9 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface) wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, NULL); } + if (wayland_egl_surface->wl_proxy) + wl_proxy_set_queue(wayland_egl_surface->wl_proxy, NULL); + wl_event_queue_destroy(queue); return TPL_ERROR_NONE; @@ -761,6 +778,9 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface) wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, NULL); } + if (wayland_egl_surface->wl_proxy) + wl_proxy_set_queue(wayland_egl_surface->wl_proxy, NULL); + wl_event_queue_destroy(queue); return ret; } -- 2.7.4