forked from enlightenment/efl
Revert "ecore_wl2: Kill the wl idle enterer"
This reverts commit 57d5b5921e
.
We need the dispatch, not the flush...
This commit is contained in:
parent
549f167002
commit
e23854eb6a
|
@ -10,6 +10,7 @@
|
|||
static Eina_Hash *_server_displays = NULL;
|
||||
static Eina_Hash *_client_displays = NULL;
|
||||
|
||||
static Eina_Bool _cb_connect_idle(void *data);
|
||||
static Eina_Bool _cb_connect_data(void *data, Ecore_Fd_Handler *hdl);
|
||||
static Eina_Bool _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync);
|
||||
|
||||
|
@ -449,6 +450,8 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
|
|||
Ecore_Wl2_Window *window;
|
||||
|
||||
eina_hash_free_buckets(ewd->globals);
|
||||
ecore_idle_enterer_del(ewd->idle_enterer);
|
||||
ewd->idle_enterer = NULL;
|
||||
|
||||
ecore_main_fd_handler_del(ewd->fd_hdl);
|
||||
ewd->fd_hdl = NULL;
|
||||
|
@ -539,6 +542,40 @@ _cb_globals_hash_del(void *data)
|
|||
free(global);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_connect_idle(void *data)
|
||||
{
|
||||
Ecore_Wl2_Display *ewd = data;
|
||||
int ret = 0, code;
|
||||
|
||||
ret = wl_display_get_error(ewd->wl.display);
|
||||
code = errno;
|
||||
if (ret < 0) goto err;
|
||||
|
||||
ret = wl_display_dispatch_pending(ewd->wl.display);
|
||||
code = errno;
|
||||
if (ret < 0) goto err;
|
||||
|
||||
ret = wl_display_flush(ewd->wl.display);
|
||||
code = errno;
|
||||
if ((ret < 0) && (code == EAGAIN))
|
||||
ecore_main_fd_handler_active_set(ewd->fd_hdl,
|
||||
(ECORE_FD_READ | ECORE_FD_WRITE));
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
|
||||
err:
|
||||
if ((ret < 0) && (code != EAGAIN))
|
||||
{
|
||||
ewd->idle_enterer = NULL;
|
||||
_begin_recovery_maybe(ewd, code);
|
||||
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static Ecore_Wl2_Global *
|
||||
_ecore_wl2_global_find(Ecore_Wl2_Display *ewd, const char *interface)
|
||||
{
|
||||
|
@ -661,6 +698,8 @@ _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync)
|
|||
ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
|
||||
_cb_connect_data, ewd, NULL, NULL);
|
||||
|
||||
ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd);
|
||||
|
||||
_ecore_wl2_display_event(ewd, ECORE_WL2_EVENT_CONNECT);
|
||||
ecore_wl2_display_flush(ewd);
|
||||
return EINA_TRUE;
|
||||
|
@ -683,6 +722,8 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
|
|||
EINA_INLIST_FOREACH_SAFE(ewd->outputs, tmp, output)
|
||||
_ecore_wl2_output_del(output);
|
||||
|
||||
if (ewd->idle_enterer) ecore_idle_enterer_del(ewd->idle_enterer);
|
||||
|
||||
if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
|
||||
|
||||
eina_hash_free(ewd->globals);
|
||||
|
|
|
@ -100,6 +100,7 @@ struct _Ecore_Wl2_Display
|
|||
|
||||
struct xkb_context *xkb_context;
|
||||
|
||||
Ecore_Idle_Enterer *idle_enterer;
|
||||
Ecore_Fd_Handler *fd_hdl;
|
||||
|
||||
Eina_Hash *globals;
|
||||
|
|
Loading…
Reference in New Issue