tpl_wayland_egl_thread: remove wl_event_queue from input parameter 57/134757/3
authorSangjin Lee <lsj119@samsung.com>
Mon, 17 Apr 2017 10:15:16 +0000 (19:15 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 21 Jun 2017 07:04:24 +0000 (16:04 +0900)
Change-Id: Iece9723b18f9ca5339c956747c9ee1c8b757292a

src/tpl_wayland_egl_thread.c
src/tpl_wayland_egl_thread.h

index ed9a460..0605630 100644 (file)
@@ -129,6 +129,11 @@ _twe_thread_wl_disp_dispatch(GSource *source, GSourceFunc cb, gpointer date)
 static void
 _twe_thread_wl_disp_finalize(GSource *source)
 {
+       twe_wl_disp_source *wl_source = (twe_wl_disp_source *)source;
+
+       wl_display_dispatch_queue(wl_source->disp, wl_source->ev_queue);
+       wl_event_queue_destroy(wl_source->ev_queue);
+
        return;
 }
 
@@ -141,8 +146,7 @@ static GSourceFuncs _twe_wl_disp_funcs = {
 
 void
 twe_thread_add_wl_display(twe_thread* thread,
-                                                 struct wl_display *display,
-                                                 struct wl_event_queue *ev_queue)
+                                                 struct wl_display *display)
 {
        twe_thread_context *ctx = thread->ctx;
        twe_wl_disp_source *source;
@@ -150,7 +154,7 @@ twe_thread_add_wl_display(twe_thread* thread,
        source = (twe_wl_disp_source *)g_source_new(&_twe_wl_disp_funcs,
                                                                                                sizeof(twe_wl_disp_source));
        source->disp = display;
-       source->ev_queue = ev_queue;
+       source->ev_queue = wl_display_create_queue(display);
        source->gfd.fd = wl_display_get_fd(display);
        source->gfd.events = G_IO_IN | G_IO_ERR;
        source->gfd.revents = 0;
index 02ab672..dc394a4 100644 (file)
@@ -15,8 +15,11 @@ twe_thread_destroy(twe_thread* thread);
 
 void
 twe_thread_add_wl_display(twe_thread* thread,
-                                                 struct wl_display *display,
-                                                 struct wl_event_queue *ev_queue);
+                                                               struct wl_display *display);
+
+void
+twe_thread_del_wl_display(twe_thread* thread,
+                                                          struct wl_display *display);
 
 void
 twe_thread_add_wl_surface(twe_thread* thread,