struct wl_event_queue *ev_queue;
struct wayland_tbm_client *wl_tbm_client;
struct tizen_surface_shm *tss; /* used for surface buffer_flush */
+ tpl_bool_t prepared;
twe_thread *thread;
tpl_object_t obj;
/* TODO : surface list */
{
twe_wl_disp_source *disp_source = (twe_wl_disp_source *)source;
+ /* If disp_source is already prepared, do nothing in this function. */
+ if (disp_source->prepared)
+ return FALSE;
+
while (wl_display_prepare_read_queue(disp_source->disp,
disp_source->ev_queue) != 0) {
if (wl_display_dispatch_queue_pending(disp_source->disp,
disp_source->ev_queue) == -1) {
_twe_display_print_err(disp_source, "dispatch_queue_pending");
}
+
+ disp_source->prepared = TPL_TRUE;
}
wl_display_flush(disp_source->disp);
_twe_thread_wl_disp_check(GSource *source)
{
twe_wl_disp_source *disp_source = (twe_wl_disp_source *)source;
+ gboolean ret = FALSE;
if (g_source_is_destroyed(source)) {
TPL_ERR("display source(%p) already destroyed.", source);
- return FALSE;
+ return ret;
}
if (disp_source->gfd.revents & G_IO_IN) {
if (wl_display_read_events(disp_source->disp) == -1)
_twe_display_print_err(disp_source, "read_event.");
-
- return TRUE;
+ ret = TRUE;
} else {
wl_display_cancel_read(disp_source->disp);
+ ret = FALSE;
}
- return FALSE;
+ disp_source->prepared = TPL_FALSE;
+
+ return ret;
}
static gboolean
twe_wl_disp_source *disp_source = (twe_wl_disp_source *)source;
TPL_OBJECT_LOCK(&disp_source->obj);
+ /* If disp_source is in prepared state, cancel it */
+ if (disp_source->prepared)
+ wl_display_cancel_read(disp_source->disp);
+
if (wl_display_dispatch_queue_pending(disp_source->disp,
disp_source->ev_queue) == -1) {
_twe_display_print_err(disp_source, "dispatch_queue_pending");
source->disp = display;
source->ev_queue = ev_queue;
source->wl_tbm_client = wl_tbm_client;
+ source->prepared = TPL_FALSE;
source->gfd.fd = wl_display_get_fd(display);
source->gfd.events = G_IO_IN | G_IO_ERR;
source->gfd.revents = 0;
surf_source->latest_transform = wl_egl_window->transform;
buf_info->rotated = TPL_TRUE;
}
+
buf_info->transform = wl_egl_window->transform;
buf_info->dx = wl_egl_window->dx;
buf_info->dy = wl_egl_window->dy;