source->gfd.events = G_IO_IN | G_IO_ERR;
source->gfd.revents = 0;
+ g_source_set_callback(&source->gsource, NULL, display, NULL);
g_source_add_poll(&source->gsource, &source->gfd);
g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop));
g_source_unref(&source->gsource);
}
void
+twe_thread_del_wl_display(twe_thread* thread, struct wl_display *display)
+{
+ twe_wl_disp_source *source;
+
+ source = (twe_wl_disp_source *)g_main_context_find_source_by_user_data(g_main_loop_get_context(thread->ctx->twe_loop), display);
+ if (!source) {
+ printf("ERR: Cannot find wl_display:%d\n", display);
+ return;
+ }
+
+ g_source_destroy(&source->gsource);
+ g_source_unref(&source->gsource);
+}
+
+void
twe_thread_add_wl_surface(twe_thread* thread,
struct wl_surface *surface,
tbm_surface_queue_h surface_queue)