struct wl_callback *callback;
int done = 0, ret = 0;
- callback = wl_display_sync(dri2_dpy->wl_dpy);
+ callback = wl_display_sync(dri2_dpy->wl_dpy_wrapper);
wl_callback_add_listener(callback, &sync_listener, &done);
- wl_proxy_set_queue((struct wl_proxy *) callback, dri2_dpy->wl_queue);
while (ret != -1 && !done)
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
* handle the commit and send a release event before checking for a free
* buffer */
if (dri2_surf->throttle_callback == NULL) {
- dri2_surf->throttle_callback = wl_display_sync(dri2_dpy->wl_dpy);
+ dri2_surf->throttle_callback = wl_display_sync(dri2_dpy->wl_dpy_wrapper);
wl_callback_add_listener(dri2_surf->throttle_callback,
&throttle_listener, dri2_surf);
- wl_proxy_set_queue((struct wl_proxy *) dri2_surf->throttle_callback,
- dri2_dpy->wl_queue);
}
wl_display_flush(dri2_dpy->wl_dpy);
dri2_dpy->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
+ dri2_dpy->wl_dpy_wrapper = wl_proxy_create_wrapper(dri2_dpy->wl_dpy);
+ if (dri2_dpy->wl_dpy_wrapper == NULL)
+ goto cleanup_dpy_wrapper;
+
+ wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_dpy_wrapper,
+ dri2_dpy->wl_queue);
+
if (dri2_dpy->own_device)
wl_display_dispatch_pending(dri2_dpy->wl_dpy);
- dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy);
- wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_registry,
- dri2_dpy->wl_queue);
+ dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy_wrapper);
wl_registry_add_listener(dri2_dpy->wl_registry,
®istry_listener_drm, dri2_dpy);
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_drm == NULL)
wl_drm_destroy(dri2_dpy->wl_drm);
cleanup_registry:
wl_registry_destroy(dri2_dpy->wl_registry);
+ wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
+ cleanup_dpy_wrapper:
wl_event_queue_destroy(dri2_dpy->wl_queue);
if (disp->PlatformDisplay == NULL)
wl_display_disconnect(dri2_dpy->wl_dpy);
* handle the commit and send a release event before checking for a free
* buffer */
if (dri2_surf->throttle_callback == NULL) {
- dri2_surf->throttle_callback = wl_display_sync(dri2_dpy->wl_dpy);
+ dri2_surf->throttle_callback = wl_display_sync(dri2_dpy->wl_dpy_wrapper);
wl_callback_add_listener(dri2_surf->throttle_callback,
&throttle_listener, dri2_surf);
- wl_proxy_set_queue((struct wl_proxy *) dri2_surf->throttle_callback,
- dri2_dpy->wl_queue);
}
wl_display_flush(dri2_dpy->wl_dpy);
dri2_dpy->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
+ dri2_dpy->wl_dpy_wrapper = wl_proxy_create_wrapper(dri2_dpy->wl_dpy);
+ if (dri2_dpy->wl_dpy_wrapper == NULL)
+ goto cleanup_dpy_wrapper;
+
+ wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_dpy_wrapper,
+ dri2_dpy->wl_queue);
+
if (dri2_dpy->own_device)
wl_display_dispatch_pending(dri2_dpy->wl_dpy);
- dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy);
- wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_registry,
- dri2_dpy->wl_queue);
+ dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy_wrapper);
wl_registry_add_listener(dri2_dpy->wl_registry,
®istry_listener_swrast, dri2_dpy);
wl_shm_destroy(dri2_dpy->wl_shm);
cleanup_registry:
wl_registry_destroy(dri2_dpy->wl_registry);
+ wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
+ cleanup_dpy_wrapper:
wl_event_queue_destroy(dri2_dpy->wl_queue);
if (disp->PlatformDisplay == NULL)
wl_display_disconnect(dri2_dpy->wl_dpy);