static Eina_Bool
_wl_init(void)
{
+ struct wl_display *display_wrapper = NULL;
struct wl_registry *reg = NULL;
if (_eflutil.wl.init) return EINA_TRUE;
_eflutil.wl.dpy = ecore_wl_display_get();
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
+ display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
+ EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail);
+
_eflutil.wl.queue = wl_display_create_queue(_eflutil.wl.dpy);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.queue, fail);
- reg = wl_display_get_registry(_eflutil.wl.dpy);
+ wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.queue);
+
+ reg = wl_display_get_registry(display_wrapper);
+ wl_proxy_wrapper_destroy(display_wrapper);
EINA_SAFETY_ON_NULL_GOTO(reg, fail);
- wl_proxy_set_queue((struct wl_proxy*)reg, _eflutil.wl.queue);
wl_registry_add_listener(reg, &_wl_reg_listener, NULL);
_eflutil.wl.init = EINA_TRUE;
return EINA_TRUE;
fail:
+ if (display_wrapper)
+ wl_proxy_wrapper_destroy(display_wrapper);
+
if (_eflutil.wl.queue)
{
wl_event_queue_destroy(_eflutil.wl.queue);
_eflutil.wl.shot.queue = wl_display_create_queue(_eflutil.wl.dpy);
EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_init);
+ wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.shot.queue);
+
reg = wl_display_get_registry(display_wrapper);
+ wl_proxy_wrapper_destroy(display_wrapper);
EINA_SAFETY_ON_NULL_GOTO(reg, fail_init);
- wl_proxy_set_queue((struct wl_proxy*)reg, _eflutil.wl.shot.queue);
-
wl_registry_add_listener(reg, &_wl_reg_screenshooter_listener, NULL);
ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);