Sometimes wl input is not ready, because it is async process to create
wl input.
Signed-off-by: Hosang Kim <hosang12.kim@samsung.com>
Change-Id: I8869fb51f178425830dc1ff3825c60e2b7920b68
EAPI Ecore_Wl_Input *
ecore_wl_input_get(void)
{
+ if (!_ecore_wl_disp)
+ {
+ ERR("Ecore_Wl_Display doesn't exist");
+ return NULL;
+ }
+ if (!_ecore_wl_disp->input)
+ {
+ int loop_count = 5;
+ while ((!_ecore_wl_disp->input) && (loop_count > 0))
+ {
+ if (!_ecore_wl_disp->wl.display)
+ {
+ ERR("Wayland display doesn't exist");
+ return NULL;
+ }
+ wl_display_roundtrip(_ecore_wl_disp->wl.display);
+ loop_count--;
+ }
+ }
return _ecore_wl_disp->input;
}