typedef struct _tdm_private_client {
struct wl_display *display;
+ struct wl_event_queue *queue;
struct wl_registry *registry;
struct wl_tdm *tdm;
struct list_head output_list;
private_client->display = wl_display_connect("tdm-socket");
TDM_GOTO_IF_FAIL(private_client->display != NULL, create_failed);
+ private_client->queue = wl_display_create_queue(private_client->display);
+ TDM_GOTO_IF_FAIL(private_client->queue != NULL, create_failed);
+
private_client->registry = wl_display_get_registry(private_client->display);
TDM_GOTO_IF_FAIL(private_client->registry != NULL, create_failed);
wl_tdm_destroy(private_client->tdm);
if (private_client->registry)
wl_registry_destroy(private_client->registry);
+ if (private_client->queue)
+ wl_event_queue_destroy(private_client->queue);
if (private_client->display)
wl_display_disconnect(private_client->display);
{
tdm_private_client *private_client;
tdm_private_client_output *private_output = NULL;
+ struct wl_proxy *wrapper;
if (error)
*error = TDM_ERROR_NONE;
return (tdm_client_output*)private_output;
}
+ wrapper = wl_proxy_create_wrapper(private_client->tdm);
+ if (!wrapper) {
+ TDM_ERR("create output_wrapper failed");
+ if (error)
+ *error = TDM_ERROR_OUT_OF_MEMORY;
+ return NULL;
+ }
+
+ wl_proxy_set_queue(wrapper, private_client->queue);
+
private_output = calloc(1, sizeof *private_output);
if (!private_output) {
+ wl_proxy_wrapper_destroy(wrapper);
TDM_ERR("alloc failed");
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
private_output->private_client = private_client;
snprintf(private_output->name, TDM_NAME_LEN, "%s", name);
- private_output->output = wl_tdm_create_output(private_client->tdm, private_output->name);
+ private_output->output = wl_tdm_create_output((struct wl_tdm *)wrapper, private_output->name);
+ wl_proxy_wrapper_destroy(wrapper);
if (!private_output->output) {
TDM_ERR("couldn't create output resource");
free(private_output);
wl_tdm_output_add_listener(private_output->output,
&tdm_client_output_listener, private_output);
- wl_display_roundtrip(private_client->display);
+ wl_display_roundtrip_queue(private_client->display, private_client->queue);
+
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, NULL);
return (tdm_client_output*)private_output;
}
private_client = private_output->private_client;
TDM_RETURN_VAL_IF_FAIL(private_client != NULL, TDM_ERROR_INVALID_PARAMETER);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, private_client->queue);
wl_tdm_output_get_mode(private_output->output);
- wl_display_roundtrip(private_client->display);
+ wl_display_roundtrip_queue(private_client->display, private_client->queue);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, NULL);
*refresh = private_output->refresh;
private_client = private_output->private_client;
TDM_RETURN_VAL_IF_FAIL(private_client != NULL, TDM_ERROR_INVALID_PARAMETER);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, private_client->queue);
wl_tdm_output_get_connection(private_output->output);
- wl_display_roundtrip(private_client->display);
+ wl_display_roundtrip_queue(private_client->display, private_client->queue);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, NULL);
*status = private_output->connection;
private_client = private_output->private_client;
TDM_RETURN_VAL_IF_FAIL(private_client != NULL, TDM_ERROR_INVALID_PARAMETER);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, private_client->queue);
wl_tdm_output_get_dpms(private_output->output);
- wl_display_roundtrip(private_client->display);
+ wl_display_roundtrip_queue(private_client->display, private_client->queue);
+ wl_proxy_set_queue((struct wl_proxy *)private_output->output, NULL);
*dpms = private_output->dpms;
tdm_private_client *private_client;
tdm_private_client_output *private_output;
tdm_private_client_vblank *private_vblank;
+ struct wl_proxy *wrapper;
if (error)
*error = TDM_ERROR_NONE;
return NULL;
}
+ wrapper = wl_proxy_create_wrapper(private_output->output);
+ if (!wrapper) {
+ TDM_ERR("create output_wrapper failed");
+ if (error)
+ *error = TDM_ERROR_OUT_OF_MEMORY;
+ return NULL;
+ }
+
+ wl_proxy_set_queue(wrapper, private_client->queue);
+
private_vblank = calloc(1, sizeof *private_vblank);
if (!private_vblank) {
TDM_ERR("alloc failed");
+ wl_proxy_wrapper_destroy(wrapper);
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
private_vblank->private_output = private_output;
- private_vblank->vblank = wl_tdm_output_create_vblank(private_output->output);
+ private_vblank->vblank = wl_tdm_output_create_vblank((struct wl_tdm_output*)wrapper);
+ wl_proxy_wrapper_destroy(wrapper);
if (!private_vblank->vblank) {
TDM_ERR("couldn't create vblank resource");
free(private_vblank);
wl_tdm_vblank_add_listener(private_vblank->vblank,
&tdm_client_vblank_listener, private_vblank);
- wl_display_roundtrip(private_client->display);
+ wl_display_roundtrip_queue(private_client->display, private_client->queue);
+
+ wl_proxy_set_queue((struct wl_proxy *)private_vblank->vblank, NULL);
return (tdm_client_vblank*)private_vblank;
}