#include "e_comp_wl_intern.h"
+#include "e_main_intern.h"
#include "e_foreign_intern.h"
#include "e_wtz_shell_intern.h"
#include "e_client_intern.h"
}
static Eina_Bool
-_e_comp_wl_cb_idle_exiter(void *data EINA_UNUSED)
-{
- e_comp_wl->idle_exiter_timestamp = ecore_time_get() * 1000;
-
- TRACE_DS_ASYNC_BEGIN((intptr_t)&e_comp_wl->idle_exiter_timestamp,
- IDLE_EXITER~CB_PREPARE);
-
- return ECORE_CALLBACK_RENEW;
-}
-
-static Eina_Bool
_e_comp_wl_cb_read(void *data EINA_UNUSED, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
/* dispatch pending wayland events */
TRACE_DS_ASYNC_END((intptr_t)&e_comp_wl->idle_exiter_timestamp,
IDLE_EXITER~CB_PREPARE);
+
+ // _e_comp_wl_cb_prepare() function is called before idle state in ecore_main_loop.
+ // idle state means that epoll() or select() is called in ecore_main_loop.
+ e_main_hook_call(E_MAIN_HOOK_LOOP_BEFORE_IDLE_ENTER);
+}
+
+static void
+_e_comp_wl_cb_awake(void *data)
+{
+ e_comp_wl->idle_exiter_timestamp = ecore_time_get() * 1000;
+
+ TRACE_DS_ASYNC_BEGIN((intptr_t)&e_comp_wl->idle_exiter_timestamp,
+ IDLE_EXITER~CB_PREPARE);
+
+ // _e_comp_wl_cb_awake() function is called after idle state in ecore_main_loop.
+ // ecore_main_loop awake due to returning from epoll() or select()
+ e_main_hook_call(E_MAIN_HOOK_LOOP_AFTER_IDLE_EXIT);
}
E_API enum wl_output_transform
ecore_main_fd_handler_prepare_callback_set(wl_cdata->fd_hdlr,
_e_comp_wl_cb_prepare, wl_cdata);
+ /* add awake handler */
+ ecore_main_awake_handler_add(_e_comp_wl_cb_awake, NULL);
+
return EINA_TRUE;
input_err:
E_LIST_HOOK_APPEND(hooks, E_CLIENT_HOOK_RESIZE_END, _e_comp_wl_client_cb_resize_end, NULL);
E_LIST_HOOK_APPEND(hooks, E_CLIENT_HOOK_MOVE_END, _e_comp_wl_client_cb_move_end, NULL);
- e_comp_wl->idle_exiter = ecore_idle_exiter_add(_e_comp_wl_cb_idle_exiter, NULL);
-
TRACE_DS_END();
return EINA_TRUE;
}
{
E_Comp_Data *comp = (E_Comp_Data *)e_comp_wl;
- ecore_idle_exiter_del(e_comp_wl->idle_exiter);
-
e_comp_wl_subsurfaces_shutdown();
/* free handlers */
E_FREE_LIST(handlers, ecore_event_handler_del);
wl_list_remove(&comp->client_created.link);
+ /* delete awake handler */
+ ecore_main_awake_handler_del(_e_comp_wl_cb_awake);
+
e_comp_wl = NULL;
e_comp->wl_comp_data = NULL;
free(comp);