From 668850643f72daa89c857c1cc78d49578a927794 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Tue, 21 Apr 2015 12:34:44 +0900 Subject: [PATCH] e_comp_wl: add call to dispatch the requests of binding wayland global interfaces Summary: - Add call to dispatch the requests of creating a wayldand client, getting the registry, and binding global interfaces, because we need global objects immediately after we request. - Load desktop shell module while initting e_comp, not idle time. Test Plan: (1) Run enlightenment on wayland (2) If e_module attemps to make the "Error loading Module" popup window, you will see deadlock waiting for the wayland sync "done" event to be received. This means the wayland global interfaces including wl.compositor is not ready. below is the mainloop we are blocked --------------------------------------------------------------- _ecore_wl_init_wait(void) { while (!_ecore_wl_disp->init_done) wl_display_dispatch(_ecore_wl_disp->wl.display); } Change-Id: I9e3e960264ea87af4a20ec214db73bc05ef6fc73 --- src/bin/e_comp.c | 7 ++++--- src/bin/e_comp_wl.c | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 74cb15c..6a6f507 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1047,16 +1047,17 @@ e_comp_init(void) #ifdef HAVE_WL_FM "wl_fb", #endif + "wl_desktop_shell", NULL }; e_util_env_set("HYBRIS_EGLPLATFORM", "wayland"); for (test = eng; *test; test++) { - if (e_module_enable(e_module_new(*test))) - goto out; + if (!e_module_enable(e_module_new(*test))) + return EINA_FALSE; } - return EINA_FALSE; + goto out; } #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) e_comp_wl_init(); diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index efd9650..42921fb 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2657,6 +2657,17 @@ e_comp_wl_init(void) return EINA_FALSE; } + wl_event_loop_dispatch(e_comp->wl_comp_data->wl.loop, -1); //server calls wl_client_create() + + ecore_wl_flush(); // client sendmsg wl_display.get_registry request + wl_event_loop_dispatch(e_comp->wl_comp_data->wl.loop, -1); //server calls display_get_registry() + wl_display_flush_clients(e_comp->wl_comp_data->wl.disp); //server flushes wl_registry.global events + + ecore_wl_display_iterate(); //client handles global events and make 'bind' requests to each global interfaces + + ecore_wl_flush(); //client sendmsg wl_registry.bind requests + wl_event_loop_dispatch(e_comp->wl_comp_data->wl.loop, -1); //server calls registry_bind() using given interfaces' name + /* create hash to store clients */ /* clients_win_hash = eina_hash_int64_new(NULL); */ clients_buffer_hash = eina_hash_int32_new(NULL); -- 2.7.4