If the default event queue is empty, the 'wl_display_dispatch' function blocks until there are events to be read from the display fd.
So, it might cause the deadlock state of the application's process, If the event queue is empty continually because of some problem.
As for the 'wl_display_roundtrip' function,
This function blocks until the server has processed all currently issued requests by sending a request to the display server and waiting for a reply before returning.
Plus, these functions return the -1 on failure such as closed connection case. It need to be checked
Change-Id: If1e007196945422433d66bf47de58f1809f0535d
//This function should return IME filtering result with boolean type.
struct wl_display *display = ecore_wl_display_get();
if (display) {
- while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND) {
- wl_display_dispatch(display);
-
+ while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND && wl_display_roundtrip(display) != -1) {
if (imcontext->last_key_event_filter.serial == serial) {
ret = imcontext->last_key_event_filter.state;
break;