screenshot: execute wayland_tbm_client_deinit when screenshot deinit
[platform/core/api/efl-util.git] / src / efl_util.c
index 248578b..26c0482 100644 (file)
@@ -32,7 +32,7 @@
 #include <Ecore_Evas.h>
 #include <pthread.h>
 
-#include <Ecore_Wayland.h>
+#include <Ecore_Wl2.h>
 #include <wayland-client.h>
 #include <wayland-tbm-client.h>
 #include <tizen-extension-client-protocol.h>
@@ -93,21 +93,8 @@ static inline tizen_profile_t get_tizen_profile()
 
 
 #define LOG_TAG "TIZEN_N_EFL_UTIL"
-
-
-/* callback handler index */
-#define CBH_NOTI_LEV 0
-#define CBH_SCR_MODE 1
-#define CBH_MAX      2
-
-typedef void (*Efl_Util_Cb)(Evas_Object *, int, void *);
-
-typedef struct _Efl_Util_Callback_Info
-{
-   Evas_Object *win;
-   Efl_Util_Cb cb;
-   void *data;
-} Efl_Util_Callback_Info;
+#define EFL_UTIL_INPUT_GENERATOR_DEFAULT_TIME_OUT 1000
+#define EFL_UTIL_INPUT_GENERATOR_DEFAULT_DISPATCH_TIME_OUT 10
 
 typedef struct _Efl_Util_Wl_Surface_Lv_Info
 {
@@ -179,17 +166,28 @@ typedef struct _Efl_Util_Gesture_Palm_Cover_Grab_Data
    Efl_Util_Gesture_Common_Grab_Data base;
 } Efl_Util_Gesture_Palm_Cover_Grab_Data;
 
+typedef struct _Efl_Util_Device_Info
+{
+   struct tizen_input_device *device;
+   Ecore_Device_Class clas;
+   Eina_Stringshare *name;
+} Efl_Util_Device_Info;
+
 typedef struct _Efl_Util_Data
 {
    /* wayland related stuffs */
    struct
    {
       Eina_Bool init;
+      Ecore_Wl2_Display *wl2_display;
       struct wl_display *dpy;
       struct wl_event_queue *queue;
+      int dpy_fd;
+      Ecore_Fd_Handler *fd_hdl;
 
       struct
       {
+         unsigned int id;
          struct tizen_policy *proto;
          Eina_Hash *hash_noti_lv;
          Eina_Hash *hash_scr_mode;
@@ -207,9 +205,13 @@ typedef struct _Efl_Util_Data
       {
          struct tizen_input_device_manager *devicemgr;
          int request_notified;
+         Eina_List *devices;
+         Eina_List *wait_devices;
+         struct wl_event_source *wait_timer;
       } devmgr;
       struct
       {
+         unsigned int id;
          struct tizen_display_policy *proto;
          Eina_Hash *hash_brightness;
       } display_policy;
@@ -220,41 +222,27 @@ typedef struct _Efl_Util_Data
          int event_init;
       } gesture;
    } wl;
-
-   struct
-   {
-      Eina_List *info_list; /* list of callback info */
-      unsigned int atom; /* x11 atom */
-   } cb_handler[CBH_MAX];
 } Efl_Util_Data;
 
 static Efl_Util_Data _eflutil =
 {
    {
       EINA_FALSE,
-      NULL, NULL,
-      { NULL, NULL, NULL }, /* tizen_policy protocol */
+      NULL, NULL, NULL,
+      -1, NULL,
+      { 0, NULL, NULL, NULL }, /* tizen_policy protocol */
       { NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
       { NULL, -1 }, /* tizen_input_device_manager protocol */
-      { NULL, NULL }, /* display_policy protocol */
+      { 0, NULL, NULL }, /* display_policy protocol */
       { NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
    },
-   {
-      { NULL, 0 }, /* handler for notification level */
-      { NULL, 0 }  /* handler for screen mode */
-   },
 };
 
-static Eina_Bool               _cb_info_add(Evas_Object *win, Efl_Util_Cb cb, void *data, int idx);
-static Eina_Bool               _cb_info_del_by_win(Evas_Object *win, int idx);
-static Eina_List              *_cb_info_list_get(int idx);
-static Efl_Util_Callback_Info *_cb_info_find_by_win(Evas_Object *win, int idx);
 static Eina_Bool               _wl_init(void);
 static void                    _cb_wl_reg_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
 static void                    _cb_wl_reg_global_remove(void *data, struct wl_registry *reg, unsigned int name);
 static void                    _cb_wl_reg_screenshooter_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
 static void                    _cb_wl_reg_screenshooter_global_remove(void *data, struct wl_registry *reg, unsigned int name);
-static Efl_Util_Callback_Info *_cb_info_find_by_wlsurf(void *wlsurf, int idx);
 static void                    _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t is_conformant);
 static void                    _cb_wl_tz_policy_conformant_area(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h);
 static void                    _cb_wl_tz_policy_notification_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t level, uint32_t state);
@@ -264,9 +252,14 @@ static void                    _cb_wl_tz_policy_iconify_state_changed(void *data
 static void                    _cb_wl_tz_policy_supported_aux_hints(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, struct wl_array *hints, uint32_t num_hints);
 static void                    _cb_wl_tz_policy_allowed_aux_hint(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, int id);
 static void                    _cb_wl_tz_policy_aux_message(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, const char *key, const char *val, struct wl_array *options);
+static void                    _cb_wl_conformant_region(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial);
 
 static void                    _cb_wl_tz_display_policy_brightness_done(void *data, struct tizen_display_policy *tizen_display_policy, struct wl_surface *surface_resource, int32_t brightness, uint32_t state);
 
+static void                    _cb_device_info(void *data, struct tizen_input_device *tizen_input_device EINA_UNUSED, const char *name, uint32_t clas, uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED);
+static void                    _cb_event_device(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, unsigned int serial EINA_UNUSED, const char *name EINA_UNUSED, uint32_t time EINA_UNUSED);
+static void                    _cb_axis(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED);
+
 static void                    _cb_device_add(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t serial  EINA_UNUSED, const char *identifier  EINA_UNUSED, struct tizen_input_device *device  EINA_UNUSED, struct wl_seat *seat EINA_UNUSED);
 static void                    _cb_device_remove(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t serial EINA_UNUSED, const char *identifier  EINA_UNUSED, struct tizen_input_device *device EINA_UNUSED, struct wl_seat *seat EINA_UNUSED);
 static void                    _cb_error(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t errorcode);
@@ -306,6 +299,14 @@ struct tizen_policy_listener _wl_tz_policy_listener =
    _cb_wl_tz_policy_supported_aux_hints,
    _cb_wl_tz_policy_allowed_aux_hint,
    _cb_wl_tz_policy_aux_message,
+   _cb_wl_conformant_region,
+};
+
+static const struct tizen_input_device_listener _wl_tz_input_device_listener =
+{
+   _cb_device_info,
+   _cb_event_device,
+   _cb_axis,
 };
 
 struct tizen_input_device_manager_listener _wl_tz_devmgr_listener =
@@ -335,76 +336,6 @@ struct tizen_gesture_listener _wl_tz_gesture_listener =
 };
 
 static Eina_Bool
-_cb_info_add(Evas_Object *win,
-             Efl_Util_Cb cb,
-             void *data,
-             int idx)
-{
-   Efl_Util_Callback_Info *info;
-
-   info = _cb_info_find_by_win(win, idx);
-   if (info)
-     {
-        _eflutil.cb_handler[idx].info_list
-           = eina_list_remove(_eflutil.cb_handler[idx].info_list,
-                              info);
-        free(info);
-     }
-
-   info = (Efl_Util_Callback_Info *)calloc(1, sizeof(Efl_Util_Callback_Info));
-   if (!info) return EINA_FALSE;
-
-   info->win = win;
-   info->cb = cb;
-   info->data = data;
-
-   _eflutil.cb_handler[idx].info_list
-      = eina_list_append(_eflutil.cb_handler[idx].info_list,
-                         info);
-
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_cb_info_del_by_win(Evas_Object *win,
-                    int idx)
-{
-   Efl_Util_Callback_Info *info;
-
-   info = _cb_info_find_by_win(win, idx);
-   if (!info) return EINA_FALSE;
-
-   _eflutil.cb_handler[idx].info_list
-      = eina_list_remove(_eflutil.cb_handler[idx].info_list,
-                         info);
-   free(info);
-
-   return EINA_TRUE;
-}
-
-static Eina_List *
-_cb_info_list_get(int idx)
-{
-   return _eflutil.cb_handler[idx].info_list;
-}
-
-static Efl_Util_Callback_Info *
-_cb_info_find_by_win(Evas_Object *win,
-                     int idx)
-{
-   Eina_List *l, *ll;
-   Efl_Util_Callback_Info *info;
-
-   l = _cb_info_list_get(idx);
-   EINA_LIST_FOREACH(l, ll, info)
-     {
-        if (info->win == win) return info;
-     }
-
-   return NULL;
-}
-
-static Eina_Bool
 _wl_init(void)
 {
    struct wl_display *display_wrapper = NULL;
@@ -412,9 +343,11 @@ _wl_init(void)
 
    if (_eflutil.wl.init) return EINA_TRUE;
 
-   ecore_wl_init(NULL);
+   ecore_wl2_init();
 
-   _eflutil.wl.dpy = ecore_wl_display_get();
+   _eflutil.wl.wl2_display = ecore_wl2_display_connect(NULL);
+   EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.wl2_display, fail);
+   _eflutil.wl.dpy = ecore_wl2_display_get(_eflutil.wl.wl2_display);
    EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
 
    display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
@@ -445,7 +378,7 @@ fail:
         _eflutil.wl.queue = NULL;
      }
 
-   ecore_wl_shutdown();
+   ecore_wl2_shutdown();
    return EINA_FALSE;
 }
 
@@ -525,7 +458,7 @@ static const struct tizen_screenshooter_listener tz_screenshooter_listener =
 static void
 _cb_wl_reg_global(void *data,
                   struct wl_registry *reg,
-                  unsigned int name,
+                  unsigned int id,
                   const char *interface,
                   unsigned int version)
 {
@@ -533,9 +466,9 @@ _cb_wl_reg_global(void *data,
      {
         struct tizen_policy *proto;
         proto = wl_registry_bind(reg,
-                                  name,
+                                  id,
                                   &tizen_policy_interface,
-                                  1);
+                                  7);
         if (!proto) return;
 
         tizen_policy_add_listener(proto,
@@ -545,6 +478,7 @@ _cb_wl_reg_global(void *data,
         _eflutil.wl.policy.hash_noti_lv = eina_hash_pointer_new(free);
         _eflutil.wl.policy.hash_scr_mode = eina_hash_pointer_new(free);
         _eflutil.wl.policy.proto = proto;
+        _eflutil.wl.policy.id = id;
      }
    else if (strcmp(interface, "wl_output") == 0)
      {
@@ -553,17 +487,17 @@ _cb_wl_reg_global(void *data,
 
         _eflutil.wl.shot.output_list = eina_list_append(_eflutil.wl.shot.output_list, output);
 
-        output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
+        output->output = wl_registry_bind(reg, id, &wl_output_interface, version);
         wl_output_add_listener(output->output, &output_listener, output);
      }
    else if (strcmp(interface, "tizen_input_device_manager") == 0)
      {
-        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &tizen_input_device_manager_interface, version);
+        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, id, &tizen_input_device_manager_interface, version);
         tizen_input_device_manager_add_listener(_eflutil.wl.devmgr.devicemgr, &_wl_tz_devmgr_listener, NULL);
      }
    else if (!strcmp(interface, "tizen_display_policy"))
      {
-        _eflutil.wl.display_policy.proto = wl_registry_bind(reg, name, &tizen_display_policy_interface, version);
+        _eflutil.wl.display_policy.proto = wl_registry_bind(reg, id, &tizen_display_policy_interface, version);
         if (!_eflutil.wl.display_policy.proto) return;
 
         tizen_display_policy_add_listener(_eflutil.wl.display_policy.proto,
@@ -571,10 +505,11 @@ _cb_wl_reg_global(void *data,
                                           NULL);
 
         _eflutil.wl.display_policy.hash_brightness = eina_hash_pointer_new(free);
+        _eflutil.wl.display_policy.id = id;
      }
    else if (strcmp(interface, "tizen_gesture") == 0)
      {
-        _eflutil.wl.gesture.proto = wl_registry_bind(reg, name, &tizen_gesture_interface, version);
+        _eflutil.wl.gesture.proto = wl_registry_bind(reg, id, &tizen_gesture_interface, version);
         tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
      }
 }
@@ -582,14 +517,24 @@ _cb_wl_reg_global(void *data,
 static void
 _cb_wl_reg_global_remove(void *data,
                          struct wl_registry *reg,
-                         unsigned int name)
+                         unsigned int id)
 {
-   _eflutil.wl.policy.proto = NULL;
-   eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
-   eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
-
-   _eflutil.wl.display_policy.proto = NULL;
-   eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+   /* unset each global id number to 0 since global id is started
+    * from number 1 on server side display structure
+    */
+   if (id == _eflutil.wl.policy.id)
+     {
+        _eflutil.wl.policy.id = 0;
+        _eflutil.wl.policy.proto = NULL;
+        eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+        eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+     }
+   else if (id == _eflutil.wl.display_policy.id)
+     {
+        _eflutil.wl.display_policy.id = 0;
+        _eflutil.wl.display_policy.proto = NULL;
+        eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+     }
 }
 /* LCOV_EXCL_STOP */
 
@@ -622,26 +567,6 @@ _cb_wl_reg_screenshooter_global_remove(void *data,
 {
 }
 
-static Efl_Util_Callback_Info *
-_cb_info_find_by_wlsurf(void *wlsurf,
-                        int idx)
-{
-   Eina_List *l, *ll;
-   Efl_Util_Callback_Info *info;
-   Ecore_Wl_Window *wlwin2 = NULL;
-   void *wlsurf2 = NULL;
-
-   l = _cb_info_list_get(idx);
-   EINA_LIST_FOREACH(l, ll, info)
-     {
-        wlwin2 = elm_win_wl_window_get(info->win);
-        wlsurf2 = ecore_wl_window_surface_get(wlwin2);
-        if (wlsurf== wlsurf2) return info;
-     }
-
-   return NULL;
-}
-
 static void
 _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy,
                             struct wl_surface *surface, uint32_t is_conformant)
@@ -664,7 +589,6 @@ _cb_wl_tz_policy_notification_done(void *data,
                                    uint32_t state)
 {
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
-   Efl_Util_Callback_Info *cb_info;
 
    lv_info = eina_hash_find(_eflutil.wl.policy.hash_noti_lv, &surface);
    if (lv_info)
@@ -673,16 +597,6 @@ _cb_wl_tz_policy_notification_done(void *data,
         lv_info->wait_for_done = EINA_FALSE;
         lv_info->state = state;
      }
-
-   if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
-
-   cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_NOTI_LEV);
-   if (!cb_info) return;
-   if (!cb_info->cb) return;
-
-   cb_info->cb(cb_info->win,
-               EFL_UTIL_ERROR_PERMISSION_DENIED,
-               cb_info->data);
 }
 
 /* LCOV_EXCL_START */
@@ -699,9 +613,7 @@ _cb_wl_tz_policy_scr_mode_done(void *data,
                                uint32_t mode,
                                uint32_t state)
 {
-
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
-   Efl_Util_Callback_Info *cb_info;
 
    scr_mode_info = eina_hash_find(_eflutil.wl.policy.hash_scr_mode, &surface);
    if (scr_mode_info)
@@ -710,16 +622,6 @@ _cb_wl_tz_policy_scr_mode_done(void *data,
         scr_mode_info->wait_for_done = EINA_FALSE;
         scr_mode_info->state = state;
      }
-
-   if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
-
-   cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_SCR_MODE);
-   if (!cb_info) return;
-   if (!cb_info->cb) return;
-
-   cb_info->cb(cb_info->win,
-               EFL_UTIL_ERROR_PERMISSION_DENIED,
-               cb_info->data);
 }
 
 /* LCOV_EXCL_START */
@@ -738,6 +640,9 @@ static void                    _cb_wl_tz_policy_allowed_aux_hint(void *data, str
 static void                    _cb_wl_tz_policy_aux_message(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, const char *key, const char *val, struct wl_array *options)
 {
 }
+static void                    _cb_wl_conformant_region(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial)
+{
+}
 /* LCOV_EXCL_STOP */
 
 static void
@@ -781,46 +686,30 @@ efl_util_set_notification_window_level(Evas_Object *window,
                                    (level <= EFL_UTIL_NOTIFICATION_LEVEL_TOP),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   if (level == EFL_UTIL_NOTIFICATION_LEVEL_1)
-     {
-        dlog_print(DLOG_WARN, LOG_TAG,
-          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_1 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT instead.");
-     }
-   else if (level == EFL_UTIL_NOTIFICATION_LEVEL_2)
-     {
-        dlog_print(DLOG_WARN, LOG_TAG,
-          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_2 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM instead.");
-     }
-   else if (level == EFL_UTIL_NOTIFICATION_LEVEL_3)
-     {
-        dlog_print(DLOG_WARN, LOG_TAG,
-          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_3 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_TOP instead.");
-     }
-
    Elm_Win_Type type;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
-   Ecore_Wl_Window_Type wl_type;
+   Ecore_Wl2_Window_Type wl_type;
 
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
    type = elm_win_type_get(window);
    if (type != ELM_WIN_NOTIFICATION)
      {
-        wl_type = ecore_wl_window_type_get(wlwin);
-        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+        wl_type = ecore_wl2_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL2_WINDOW_TYPE_NOTIFICATION),
                                         EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
      }
 
    while (!_eflutil.wl.policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
@@ -857,7 +746,7 @@ efl_util_set_notification_window_level(Evas_Object *window,
         int count = 0;
         while (lv_info->wait_for_done && (count < 3))
           {
-             ecore_wl_flush();
+             ecore_wl2_display_flush(_eflutil.wl.wl2_display);
              wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
              count++;
           }
@@ -888,29 +777,29 @@ efl_util_get_notification_window_level(Evas_Object *window,
    EINA_SAFETY_ON_NULL_RETURN_VAL(level, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
    Elm_Win_Type type;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
-   Ecore_Wl_Window_Type wl_type;
+   Ecore_Wl2_Window_Type wl_type;
 
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
    type = elm_win_type_get(window);
    if (type != ELM_WIN_NOTIFICATION)
      {
-        wl_type = ecore_wl_window_type_get(wlwin);
-        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+        wl_type = ecore_wl2_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL2_WINDOW_TYPE_NOTIFICATION),
                                         EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
      }
 
    while (!_eflutil.wl.policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
@@ -922,7 +811,7 @@ efl_util_get_notification_window_level(Evas_Object *window,
              int count = 0;
              while ((lv_info->wait_for_done) && (count < 3))
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                   count++;
                }
@@ -936,9 +825,6 @@ efl_util_get_notification_window_level(Evas_Object *window,
 
         switch (lv_info->level)
           {
-           case TIZEN_POLICY_LEVEL_1:       *level = EFL_UTIL_NOTIFICATION_LEVEL_1;       break;
-           case TIZEN_POLICY_LEVEL_2:       *level = EFL_UTIL_NOTIFICATION_LEVEL_2;       break;
-           case TIZEN_POLICY_LEVEL_3:       *level = EFL_UTIL_NOTIFICATION_LEVEL_3;       break;
            case TIZEN_POLICY_LEVEL_NONE:    *level = EFL_UTIL_NOTIFICATION_LEVEL_NONE;    break;
            case TIZEN_POLICY_LEVEL_DEFAULT: *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT; break;
            case TIZEN_POLICY_LEVEL_MEDIUM:  *level = EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM;  break;
@@ -956,44 +842,6 @@ efl_util_get_notification_window_level(Evas_Object *window,
 }
 
 API int
-efl_util_set_notification_window_level_error_cb(Evas_Object *window,
-                                                efl_util_notification_window_level_error_cb callback,
-                                                void *user_data)
-{
-   dlog_print(DLOG_WARN, LOG_TAG,
-     "DEPRECATION WARNING: efl_util_set_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead.");
-
-   Eina_Bool ret = EINA_FALSE;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ret = _cb_info_add(window,
-                      (Efl_Util_Cb)callback,
-                      user_data,
-                      CBH_NOTI_LEV);
-   if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY;
-
-   return EFL_UTIL_ERROR_NONE;
-}
-
-API int
-efl_util_unset_notification_window_level_error_cb(Evas_Object *window)
-{
-   dlog_print(DLOG_WARN, LOG_TAG,
-     "DEPRECATION WARNING: efl_util_unset_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead.");
-
-   Eina_Bool ret = EINA_FALSE;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ret = _cb_info_del_by_win(window, CBH_NOTI_LEV);
-   if (!ret) return EFL_UTIL_ERROR_INVALID_PARAMETER;
-
-   return EFL_UTIL_ERROR_NONE;
-}
-
-API int
 efl_util_set_window_opaque_state(Evas_Object *window,
                                  int opaque)
 {
@@ -1003,7 +851,7 @@ efl_util_set_window_opaque_state(Evas_Object *window,
    EINA_SAFETY_ON_FALSE_RETURN_VAL(((opaque >= 0) && (opaque <= 1)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
 
    if (!_eflutil.wl.policy.proto)
@@ -1019,11 +867,11 @@ efl_util_set_window_opaque_state(Evas_Object *window,
         EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.policy.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
      }
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin)
       return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
-   surface  = ecore_wl_window_surface_get(wlwin);
+   surface  = ecore_wl2_window_surface_get(wlwin);
    if (!surface)
       return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
@@ -1041,7 +889,7 @@ efl_util_set_window_screen_mode(Evas_Object *window,
                                     (mode <= EFL_UTIL_SCREEN_MODE_ALWAYS_ON)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
    Eina_Bool res;
@@ -1049,13 +897,13 @@ efl_util_set_window_screen_mode(Evas_Object *window,
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1088,7 +936,7 @@ efl_util_set_window_screen_mode(Evas_Object *window,
              int count = 0;
              while (scr_mode_info->wait_for_done && (count < 3))
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                   count++;
                }
@@ -1119,7 +967,7 @@ efl_util_get_window_screen_mode(Evas_Object *window,
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_NULL_RETURN_VAL(mode, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
    Eina_Bool res;
@@ -1127,13 +975,13 @@ efl_util_get_window_screen_mode(Evas_Object *window,
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1144,7 +992,7 @@ efl_util_get_window_screen_mode(Evas_Object *window,
                {
                   while (scr_mode_info->wait_for_done)
                     {
-                       ecore_wl_flush();
+                       ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                        wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                     }
                }
@@ -1169,55 +1017,9 @@ efl_util_get_window_screen_mode(Evas_Object *window,
 }
 
 API int
-efl_util_set_window_screen_mode_error_cb(Evas_Object *window,
-                                         efl_util_window_screen_mode_error_cb callback,
-                                         void *user_data)
-{
-   /* Wearable device cannot use this. */
-   if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
-     return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
-
-   dlog_print(DLOG_WARN, LOG_TAG,
-     "DEPRECATION WARNING: efl_util_set_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
-
-   Eina_Bool ret = EINA_FALSE;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ret = _cb_info_add(window,
-                      (Efl_Util_Cb)callback,
-                      user_data,
-                      CBH_SCR_MODE);
-   if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY;
-
-   return EFL_UTIL_ERROR_NONE;
-}
-
-API int
-efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
-{
-   /* Wearable device cannot use this. */
-   if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
-     return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
-
-   dlog_print(DLOG_WARN, LOG_TAG,
-     "DEPRECATION WARNING: efl_util_unset_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
-
-   Eina_Bool ret = EINA_FALSE;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ret = _cb_info_del_by_win(window, CBH_SCR_MODE);
-   if (!ret) return EFL_UTIL_ERROR_INVALID_PARAMETER;
-
-   return EFL_UTIL_ERROR_NONE;
-}
-
-API int
 efl_util_set_window_brightness(Evas_Object *window, int brightness)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
    Eina_Bool res;
@@ -1228,13 +1030,13 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.display_policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1267,7 +1069,7 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
               int count = 0;
               while (brightness_info->wait_for_done && (count < 3))
                 {
-                   ecore_wl_flush();
+                   ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                    wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                    count++;
                 }
@@ -1293,7 +1095,7 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
 API int
 efl_util_get_window_brightness(Evas_Object *window, int *brightness)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
    Eina_Bool res;
@@ -1304,13 +1106,13 @@ efl_util_get_window_brightness(Evas_Object *window, int *brightness)
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
    while (!_eflutil.wl.display_policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1321,7 +1123,7 @@ efl_util_get_window_brightness(Evas_Object *window, int *brightness)
           {
              while (brightness_info->wait_for_done)
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                }
           }
@@ -1340,29 +1142,144 @@ struct _efl_util_inputgen_h
    char name[32];
 };
 
+static Eina_Bool
+_efl_util_input_check_wait_device_full(void)
+{
+   Eina_List *l, *ll, *l_next;
+   Efl_Util_Device_Info *dev, *wait_dev;
+   int wait_cnt = 0;
+
+   wait_cnt = eina_list_count(_eflutil.wl.devmgr.wait_devices);
+   if (wait_cnt <= 0) return EINA_TRUE;
+
+   EINA_LIST_FOREACH(_eflutil.wl.devmgr.devices, l, dev)
+     {
+        EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.wait_devices, ll, l_next, wait_dev)
+          {
+             if ((dev->clas == wait_dev->clas) &&
+                 (!strncmp(dev->name, wait_dev->name, eina_stringshare_strlen(wait_dev->name))))
+               {
+                  eina_stringshare_del(wait_dev->name);
+                  _eflutil.wl.devmgr.wait_devices = eina_list_remove_list(_eflutil.wl.devmgr.wait_devices, ll);
+                  free(wait_dev);
+
+                  wait_cnt--;
+                  if (wait_cnt <= 0) return EINA_TRUE;
+
+                  break;
+               }
+          }
+     }
+
+   return EINA_FALSE;
+}
+
+static Eina_Bool
+_efl_util_input_check_wait_device(const char *name, unsigned int type)
+{
+   Eina_List *l, *l_next;
+   Efl_Util_Device_Info *wait_dev;
+   int wait_cnt = 0;
+
+   wait_cnt = eina_list_count(_eflutil.wl.devmgr.wait_devices);
+   if (wait_cnt <= 0) return EINA_TRUE;
+
+   EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.wait_devices, l, l_next, wait_dev)
+     {
+        if ((type == wait_dev->clas) &&
+            (!strncmp(name, wait_dev->name, eina_stringshare_strlen(wait_dev->name))))
+          {
+             eina_stringshare_del(wait_dev->name);
+             _eflutil.wl.devmgr.wait_devices = eina_list_remove_list(_eflutil.wl.devmgr.wait_devices, l);
+             free(wait_dev);
+
+             wait_cnt--;
+             if (wait_cnt <= 0) return EINA_TRUE;
+
+             break;
+          }
+     }
+
+   return EINA_FALSE;
+}
+
+static void
+_cb_device_info(void *data, struct tizen_input_device *tizen_input_device EINA_UNUSED, const char *name, uint32_t clas, uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED)
+{
+   Efl_Util_Device_Info *dev;
+
+   if (!(dev = data)) return;
+   dev->clas = (Ecore_Device_Class)clas;
+   dev->name = eina_stringshare_add(name);
+
+   if (_eflutil.wl.devmgr.wait_timer &&
+       _efl_util_input_check_wait_device(name, clas))
+     {
+        wl_event_source_remove(_eflutil.wl.devmgr.wait_timer);
+        _eflutil.wl.devmgr.wait_timer = NULL;
+     }
+}
+
+/* LCOV_EXCL_START */
+static void
+_cb_event_device(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, unsigned int serial EINA_UNUSED, const char *name EINA_UNUSED, uint32_t time EINA_UNUSED)
+{
+   ;
+}
+
+static void
+_cb_axis(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED)
+{
+   ;
+}
+/* LCOV_EXCL_STOP */
+
 static void
 _cb_device_add(void *data EINA_UNUSED,
                struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
                uint32_t serial EINA_UNUSED,
                const char *identifier EINA_UNUSED,
-               struct tizen_input_device *device EINA_UNUSED,
+               struct tizen_input_device *device,
                struct wl_seat *seat EINA_UNUSED)
 {
-   ;
+   Efl_Util_Device_Info *dev;
+
+   EINA_SAFETY_ON_NULL_RETURN(device);
+
+   dev = (Efl_Util_Device_Info *)calloc(1, sizeof(Efl_Util_Device_Info));
+   EINA_SAFETY_ON_NULL_RETURN(dev);
+
+   dev->device = device;
+   tizen_input_device_add_listener(device, &_wl_tz_input_device_listener, dev);
+
+   _eflutil.wl.devmgr.devices = eina_list_append(_eflutil.wl.devmgr.devices, dev);
 }
 
-/* LCOV_EXCL_START */
 static void
 _cb_device_remove(void *data EINA_UNUSED,
                struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
                uint32_t serial  EINA_UNUSED,
                const char *identifier  EINA_UNUSED,
-               struct tizen_input_device *device  EINA_UNUSED,
+               struct tizen_input_device *device,
                struct wl_seat *seat  EINA_UNUSED)
 {
-   ;
+   Eina_List *l, *l_next;
+   Efl_Util_Device_Info *dev;
+
+   EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.devices, l, l_next, dev)
+     {
+        if (dev->device == device)
+          {
+             if (dev->name) eina_stringshare_del(dev->name);
+             tizen_input_device_release(dev->device);
+
+             _eflutil.wl.devmgr.devices = eina_list_remove_list(_eflutil.wl.devmgr.devices, l);
+             free(dev);
+
+             break;
+          }
+     }
 }
-/* LCOV_EXCL_STOP */
 
 static void
 _cb_error(void *data EINA_UNUSED,
@@ -1399,6 +1316,85 @@ _efl_util_input_convert_input_generator_error(int ret)
      }
 }
 
+/* LCOV_EXCL_START */
+static int
+_timer_wait(void *data)
+{
+   Efl_Util_Device_Info *dev;
+
+   _eflutil.wl.devmgr.request_notified = TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES;
+
+   if (eina_list_count(_eflutil.wl.devmgr.wait_devices) > 0)
+     {
+        EINA_LIST_FREE(_eflutil.wl.devmgr.wait_devices, dev)
+          {
+             eina_stringshare_del(dev->name);
+             dev->name = NULL;
+          }
+     }
+
+   wl_event_source_remove(_eflutil.wl.devmgr.wait_timer);
+   _eflutil.wl.devmgr.wait_timer = NULL;
+
+   return 1;
+}
+/* LCOV_EXCL_STOP */
+
+static void
+_efl_util_input_initialize_wait_device(void)
+{
+   struct wl_event_loop *loop;
+   int ret = -1;
+
+   if (_efl_util_input_check_wait_device_full()) return;
+
+   loop = wl_event_loop_create();
+   _eflutil.wl.devmgr.wait_timer = wl_event_loop_add_timer(loop, _timer_wait, NULL);
+   if (_eflutil.wl.devmgr.wait_timer)
+     {
+        ret = wl_event_source_timer_update(_eflutil.wl.devmgr.wait_timer,
+                                           EFL_UTIL_INPUT_GENERATOR_DEFAULT_TIME_OUT);
+        if (ret != 0) _timer_wait(NULL);
+        return;
+     }
+
+   while (_eflutil.wl.devmgr.wait_timer)
+     {
+        wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+        ret = wl_event_loop_dispatch(loop, EFL_UTIL_INPUT_GENERATOR_DEFAULT_DISPATCH_TIME_OUT);
+        if (ret != 0) _timer_wait(NULL);
+     }
+}
+
+static void
+_efl_util_input_initialize_append_device(const char *name, Ecore_Device_Class clas)
+{
+   Efl_Util_Device_Info *dev;
+
+   dev = (Efl_Util_Device_Info *)calloc(1, sizeof(Efl_Util_Device_Info));
+   EINA_SAFETY_ON_NULL_RETURN(dev);
+
+   dev->name = eina_stringshare_add(name);
+   dev->clas = clas;
+
+   _eflutil.wl.devmgr.wait_devices = eina_list_append(_eflutil.wl.devmgr.wait_devices, dev);
+}
+
+static void
+_efl_util_input_initialize_add_wait_device(const char *name, unsigned int dev_type)
+{
+   EINA_SAFETY_ON_NULL_RETURN(name);
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+     _efl_util_input_initialize_append_device(name, ECORE_DEVICE_CLASS_TOUCH);
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
+     _efl_util_input_initialize_append_device(name, ECORE_DEVICE_CLASS_KEYBOARD);
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_POINTER)
+     _efl_util_input_initialize_append_device(name, ECORE_DEVICE_CLASS_MOUSE);
+}
+
 API efl_util_inputgen_h
 efl_util_input_initialize_generator(unsigned int dev_type)
 {
@@ -1530,6 +1526,83 @@ out:
    return NULL;
 }
 
+API efl_util_inputgen_h
+efl_util_input_initialize_generator_with_sync(unsigned int dev_type, const char *name)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   efl_util_inputgen_h inputgen_h = NULL;
+   unsigned int clas = 0x0;
+
+   if (!dev_type ||
+        dev_type & ~(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN
+                    | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD
+                    | EFL_UTIL_INPUT_DEVTYPE_POINTER))
+     {
+        set_last_result(EFL_UTIL_ERROR_NO_SUCH_DEVICE);
+        goto out;
+     }
+
+   inputgen_h = (efl_util_inputgen_h)calloc(1, sizeof(struct _efl_util_inputgen_h));
+   if (!inputgen_h)
+     {
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+        goto out;
+     }
+
+   inputgen_h->init_type |= dev_type;
+   if (name) strncpy(inputgen_h->name, name, 31);
+   else strncpy(inputgen_h->name, "Input Generator", 31);
+
+   ret = _wl_init();
+   if (ret == (int)EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        goto out;
+     }
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_POINTER)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE;
+
+   while (!_eflutil.wl.devmgr.devicemgr)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   tizen_input_device_manager_init_generator_with_name(_eflutil.wl.devmgr.devicemgr, clas, inputgen_h->name);
+
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
+
+   if (ret == EFL_UTIL_ERROR_NONE)
+     {
+        _efl_util_input_initialize_add_wait_device(inputgen_h->name, dev_type);
+        _efl_util_input_initialize_wait_device();
+        if (_eflutil.wl.devmgr.request_notified != -1)
+          {
+             ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+             _eflutil.wl.devmgr.request_notified = -1;
+          }
+     }
+
+   set_last_result(ret);
+   if (ret != TIZEN_INPUT_DEVICE_MANAGER_ERROR_NONE)
+     goto out;
+
+   return inputgen_h;
+
+out:
+   if (inputgen_h)
+     {
+        free(inputgen_h);
+        inputgen_h = NULL;
+     }
+   return NULL;
+}
 
 API int
 efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h)
@@ -1739,11 +1812,20 @@ efl_util_screenshot_initialize(int width, int height)
    struct wl_registry *reg = NULL;
    int ret = 0;
 
-   EINA_SAFETY_ON_FALSE_GOTO(width > 0, fail_param);
-   EINA_SAFETY_ON_FALSE_GOTO(height > 0, fail_param);
+   if (width <= 0 || height <= 0)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        return NULL;
+     }
 
    _screenshot_mutex_lock();
 
+   if (!g_screenshot)
+     {
+        screenshot = calloc(1, sizeof(struct _efl_util_screenshot_h));
+        EINA_SAFETY_ON_NULL_GOTO(screenshot, fail_memory);
+     }
+
    if (!_eflutil.wl.shot.screenshooter)
      {
         ret = _wl_init();
@@ -1777,6 +1859,9 @@ efl_util_screenshot_initialize(int width, int height)
 
         _eflutil.wl.shot.tbm_client = wayland_tbm_client_init(_eflutil.wl.dpy);
         EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tbm_client, fail_init);
+
+        wl_registry_destroy(reg);
+        reg = NULL;
      }
 
    if (_eflutil.wl.shot.noti == 0)
@@ -1792,15 +1877,13 @@ efl_util_screenshot_initialize(int width, int height)
              g_screenshot->width = width;
              g_screenshot->height = height;
           }
+        set_last_result(EFL_UTIL_ERROR_NONE);
 
         _screenshot_mutex_unlock();
 
         return g_screenshot;
      }
 
-   screenshot = calloc(1, sizeof(struct _efl_util_screenshot_h));
-   EINA_SAFETY_ON_NULL_GOTO(screenshot, fail_memory);
-
    screenshot->width = width;
    screenshot->height = height;
    screenshot->auto_rotation = EINA_TRUE;
@@ -1817,19 +1900,22 @@ efl_util_screenshot_initialize(int width, int height)
 
    return g_screenshot;
 
-fail_param:
-   set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
-   return NULL;
-fail_memory:
 /* LCOV_EXCL_START */
+fail_memory:
    if (display_wrapper)
      wl_proxy_wrapper_destroy(display_wrapper);
    set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+   _screenshot_mutex_unlock();
    return NULL;
+
 fail_init:
+   if (reg)
+     wl_registry_destroy(reg);
    if (screenshot)
-     efl_util_screenshot_deinitialize(screenshot);
-   _screenshot_mutex_unlock();
+     {
+        _screenshot_mutex_unlock();
+        efl_util_screenshot_deinitialize(screenshot);
+     }
    set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
    return NULL;
 /* LCOV_EXCL_STOP */
@@ -1850,10 +1936,10 @@ efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
    free(screenshot);
    g_screenshot = NULL;
 
-   if (_eflutil.wl.shot.queue)
+   if (_eflutil.wl.shot.tbm_client)
      {
-        wl_event_queue_destroy(_eflutil.wl.shot.queue);
-        _eflutil.wl.shot.queue = NULL;
+        wayland_tbm_client_deinit(_eflutil.wl.shot.tbm_client);
+        _eflutil.wl.shot.tbm_client = NULL;
      }
 
    if (_eflutil.wl.shot.screenshooter)
@@ -1867,6 +1953,12 @@ efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
         _eflutil.wl.shot.tz_screenshooter = NULL;
      }
 
+   if (_eflutil.wl.shot.queue)
+     {
+        wl_event_queue_destroy(_eflutil.wl.shot.queue);
+        _eflutil.wl.shot.queue = NULL;
+     }
+
    _screenshot_mutex_unlock();
    _screenshot_mutex_destory();
 
@@ -1924,7 +2016,7 @@ efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot)
         goto fail;
      }
 
-   wl_buffer_destroy(buffer);
+   wayland_tbm_client_destroy_buffer(_eflutil.wl.shot.tbm_client, buffer);
 
    /* reset shot_done for next screenshot */
    screenshot->shot_done = EINA_FALSE;
@@ -1939,7 +2031,7 @@ fail:
    if (t_surface)
      tbm_surface_destroy(t_surface);
    if (buffer)
-     wl_buffer_destroy(buffer);
+     wayland_tbm_client_destroy_buffer(_eflutil.wl.shot.tbm_client, buffer);
 
    set_last_result(EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL);
 
@@ -1948,6 +2040,7 @@ fail:
    return NULL;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set)
 {
@@ -1977,6 +2070,7 @@ efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set
 
    return EFL_UTIL_ERROR_NONE;
 }
+/* LCOV_EXCL_STOP */
 
 struct _efl_util_gesture_h
 {
@@ -1988,6 +2082,7 @@ API int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0;
 API int EFL_UTIL_EVENT_GESTURE_TAP = 0;
 API int EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0;
 
+/* LCOV_EXCL_START */
 static void
 _cb_gesture_edge_swipe_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t edge EINA_UNUSED, uint32_t edge_size EINA_UNUSED, uint32_t start_point EINA_UNUSED, uint32_t end_point EINA_UNUSED, uint32_t error)
 {
@@ -2057,6 +2152,7 @@ _cb_gesture_tap(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA
 
    ecore_event_add(EFL_UTIL_EVENT_GESTURE_TAP, ev, NULL, NULL);
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t error)
@@ -2064,6 +2160,7 @@ _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tize
    _eflutil.wl.gesture.request_notified = error;
 }
 
+/* LCOV_EXCL_START */
 static void
 _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface, uint32_t mode, uint32_t duration, int cx, int cy, uint32_t size, wl_fixed_t pressure)
 {
@@ -2082,6 +2179,7 @@ _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gestu
 
    ecore_event_add(EFL_UTIL_EVENT_GESTURE_PALM_COVER, ev, NULL, NULL);
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_gesture_activate_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t type EINA_UNUSED, uint32_t active EINA_UNUSED, uint32_t error)
@@ -2111,6 +2209,7 @@ _efl_util_gesture_convert_error(int ret)
      }
 }
 
+/* LCOV_EXCL_START */
 static int
 _efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data)
 {
@@ -2376,51 +2475,78 @@ _efl_util_gesture_ungrab_palm_cover(efl_util_gesture_data data)
    return ret;
 }
 
+static Eina_Bool
+_efl_util_fd_cb(void *data, Ecore_Fd_Handler *hdl)
+{
+   if (_eflutil.wl.dpy && _eflutil.wl.queue)
+     {
+        wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+        return ECORE_CALLBACK_RENEW;
+     }
+   else
+     {
+        return ECORE_CALLBACK_CANCEL;
+     }
+}
+/* LCOV_EXCL_STOP */
+
 API efl_util_gesture_h
 efl_util_gesture_initialize(void)
 {
    efl_util_gesture_h gesture_h = NULL;
+   int dpy_fd = -1;
 
    gesture_h = (efl_util_gesture_h)calloc(1, sizeof(struct _efl_util_gesture_h));
    if (!gesture_h)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        goto out;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
      }
 
    if (_wl_init() == (int)EINA_FALSE)
      {
-        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED);
-        goto out;
+        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
      }
 
    while (!_eflutil.wl.gesture.proto)
-     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); /* LCOV_EXCL_LINE */
 
    if (_eflutil.wl.gesture.event_init <= 0)
      {
         if (ecore_event_init() <= 0)
           {
-             set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED);
-             goto out;
+             set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
+             goto out; /* LCOV_EXCL_LINE */
           }
         EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = ecore_event_type_new();
         EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = ecore_event_type_new();
         EFL_UTIL_EVENT_GESTURE_TAP = ecore_event_type_new();
         EFL_UTIL_EVENT_GESTURE_PALM_COVER = ecore_event_type_new();
+
+        dpy_fd = wl_display_get_fd(_eflutil.wl.dpy);
+        _eflutil.wl.dpy_fd = fcntl(dpy_fd, F_DUPFD_CLOEXEC, 0);
+        if (_eflutil.wl.dpy_fd >= 0)
+          _eflutil.wl.fd_hdl = ecore_main_fd_handler_add(_eflutil.wl.dpy_fd,
+                                 ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
+                                 _efl_util_fd_cb, NULL,
+                                 NULL, NULL);
      }
    _eflutil.wl.gesture.event_init++;
+   gesture_h->init = EINA_TRUE;
 
    set_last_result(EFL_UTIL_ERROR_NONE);
    return gesture_h;
 
 out:
+/* LCOV_EXCL_START */
    if (gesture_h)
      {
         free(gesture_h);
         gesture_h = NULL;
      }
    return gesture_h;
+/* LCOV_EXCL_STOP */
 }
 
 API int
@@ -2442,6 +2568,13 @@ efl_util_gesture_deinitialize(efl_util_gesture_h gesture_h)
         EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0;
         EFL_UTIL_EVENT_GESTURE_TAP = 0;
         EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0;
+        if (_eflutil.wl.dpy_fd >= 0)
+          {
+             ecore_main_fd_handler_del(_eflutil.wl.fd_hdl);
+             _eflutil.wl.fd_hdl = NULL;
+             close(_eflutil.wl.dpy_fd);
+             _eflutil.wl.dpy_fd = -1;
+          }
      }
 
    return EFL_UTIL_ERROR_NONE;
@@ -2467,8 +2600,8 @@ efl_util_gesture_edge_swipe_new(efl_util_gesture_h gesture_h, unsigned int finge
    data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Swipe_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_EDGE_SWIPE;
@@ -2539,8 +2672,8 @@ efl_util_gesture_edge_drag_new(efl_util_gesture_h gesture_h, unsigned int finger
    data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Drag_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_EDGE_DRAG;
@@ -2611,8 +2744,8 @@ efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, uns
    data = (Efl_Util_Gesture_Tap_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Tap_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_TAP;
@@ -2657,8 +2790,8 @@ efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h)
    data = (Efl_Util_Gesture_Palm_Cover_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Palm_Cover_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_PALM_COVER;
@@ -2687,6 +2820,7 @@ efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_
    return EFL_UTIL_ERROR_NONE;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
 {
@@ -2752,12 +2886,13 @@ efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data
 
    return ret;
 }
+/* LCOV_EXCL_STOP */
 
 API int
 efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data)
 {
    Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2771,10 +2906,10 @@ efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_u
    if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
      return EFL_UTIL_ERROR_NOT_SUPPORTED;
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -2793,7 +2928,7 @@ API int
 efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data)
 {
    Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2807,10 +2942,10 @@ efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl
    if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
      return EFL_UTIL_ERROR_NOT_SUPPORTED;
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -2825,6 +2960,7 @@ efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl
    return ret;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active)
 {
@@ -2844,11 +2980,12 @@ efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, E
 
    return ret;
 }
+/* LCOV_EXCL_STOP */
 
 API int
 efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2857,10 +2994,10 @@ efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Objec
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(type == EFL_UTIL_GESTURE_TYPE_NONE, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);