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
#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();
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);