+#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <wayland-client.h>
#include <tpl.h>
+#include <wayland-tbm-client.h>
typedef struct _twe_thread_context twe_thread_context;
typedef struct _twe_thread twe_thread;
{
twe_wl_disp_source *wl_source = (twe_wl_disp_source *)source;
- while (wl_display_prepare_read(wl_source->disp) != 0) {
- wl_display_dispatch_pending(wl_source->disp);
+ while (wl_display_prepare_read_queue(wl_source->disp, wl_source->ev_queue) != 0) {
+ wl_display_dispatch_queue_pending(wl_source->disp, wl_source->ev_queue);
}
wl_display_flush(wl_source->disp);
+ *time = -1;
- return TRUE;
+ return FALSE;
}
static gboolean
{
twe_wl_disp_source *wl_source = (twe_wl_disp_source *)source;
- if (wl_source->gfd.revents)
+ if (wl_source->gfd.revents) {
wl_display_read_events(wl_source->disp);
- else
+ return TRUE;
+ } else {
wl_display_cancel_read(wl_source->disp);
+ }
- return TRUE;
+ return FALSE;
}
static gboolean
source->disp = display;
source->ev_queue = ev_queue;
source->gfd.fd = wl_display_get_fd(display);
- source->gfd.events = G_IO_IN | G_IO_OUT | G_IO_ERR;
+ source->gfd.events = G_IO_IN | G_IO_ERR;
source->gfd.revents = 0;
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