forked from enlightenment/efl
ecore-wl2: Add support for idle_enterer
Summary: This fixes an issue where scrolling mouse wheel would not actually perform any scroll until another event was received. NB: Unsure if we need this for "server" connections yet Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
c5dba8cd32
commit
b89c45dbf9
|
@ -207,6 +207,38 @@ _cb_globals_hash_del(void *data)
|
||||||
free(global);
|
free(global);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_cb_connect_idle(void *data)
|
||||||
|
{
|
||||||
|
Ecore_Wl2_Display *ewd;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
ewd = data;
|
||||||
|
if (!ewd) return ECORE_CALLBACK_RENEW;
|
||||||
|
|
||||||
|
ret = wl_display_get_error(ewd->wl.display);
|
||||||
|
if (ret < 0) goto err;
|
||||||
|
|
||||||
|
ret = wl_display_dispatch_pending(ewd->wl.display);
|
||||||
|
if (ret < 0) goto err;
|
||||||
|
|
||||||
|
ret = wl_display_flush(ewd->wl.display);
|
||||||
|
if ((ret < 0) && (errno == EAGAIN))
|
||||||
|
ecore_main_fd_handler_active_set(ewd->fd_hdl,
|
||||||
|
(ECORE_FD_READ | ECORE_FD_WRITE));
|
||||||
|
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
|
||||||
|
err:
|
||||||
|
if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
|
||||||
|
{
|
||||||
|
ERR("Wayland Socket Error: %s", strerror(errno));
|
||||||
|
return ECORE_CALLBACK_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
|
_cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -264,6 +296,7 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
|
||||||
|
|
||||||
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
|
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
|
||||||
|
|
||||||
|
if (ewd->idle_enterer) ecore_idle_enterer_del(ewd->idle_enterer);
|
||||||
if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
|
if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
|
||||||
|
|
||||||
eina_hash_free(ewd->globals);
|
eina_hash_free(ewd->globals);
|
||||||
|
@ -377,6 +410,8 @@ ecore_wl2_display_connect(const char *name)
|
||||||
ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
|
ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
|
||||||
_cb_connect_data, ewd, NULL, NULL);
|
_cb_connect_data, ewd, NULL, NULL);
|
||||||
|
|
||||||
|
ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd);
|
||||||
|
|
||||||
wl_registry_add_listener(wl_display_get_registry(ewd->wl.display),
|
wl_registry_add_listener(wl_display_get_registry(ewd->wl.display),
|
||||||
&_registry_listener, ewd);
|
&_registry_listener, ewd);
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ struct _Ecore_Wl2_Display
|
||||||
|
|
||||||
struct xkb_context *xkb_context;
|
struct xkb_context *xkb_context;
|
||||||
|
|
||||||
|
Ecore_Idle_Enterer *idle_enterer;
|
||||||
Ecore_Fd_Handler *fd_hdl;
|
Ecore_Fd_Handler *fd_hdl;
|
||||||
|
|
||||||
Eina_Hash *globals;
|
Eina_Hash *globals;
|
||||||
|
|
Loading…
Reference in New Issue