From: Boram Park Date: Mon, 13 Feb 2017 07:52:54 +0000 (+0900) Subject: init: use display_wrapper to ensure that proxy has a queue X-Git-Tag: submit/tizen/20170213.112005~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=773e74361375d19d8e402736fe8872983437c12f;p=platform%2Fcore%2Fapi%2Fefl-util.git init: use display_wrapper to ensure that proxy has a queue Change-Id: Ie853212a6e42f9c568d52b46817a193e238ed2e1 --- diff --git a/src/efl_util.c b/src/efl_util.c index 5162b57..897d291 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -288,6 +288,7 @@ _cb_info_find_by_win(Evas_Object *win, static Eina_Bool _wl_init(void) { + struct wl_display *display_wrapper = NULL; struct wl_registry *reg = NULL; if (_eflutil.wl.init) return EINA_TRUE; @@ -297,19 +298,27 @@ _wl_init(void) _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); @@ -1554,11 +1563,12 @@ efl_util_screenshot_initialize(int width, int height) _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);