Remove unnecessary comment
[platform/core/api/efl-util.git] / src / efl_util.c
index d2dbca4..91ced99 100644 (file)
@@ -49,6 +49,8 @@
 #define LOG_TAG "TIZEN_N_EFL_UTIL"
 #define EFL_UTIL_INPUT_GENERATOR_TOUCH_MAX_FINGER 10
 
+#define NUM_EVENT_WAIT_DONE_COUNT 10
+
 typedef struct _Efl_Util_Wl_Surface_Lv_Info
 {
    void *surface; /* wl_surface */
@@ -769,7 +771,7 @@ efl_util_set_notification_window_level(Evas_Object *window,
    if (lv_info->wait_for_done)
      {
         int count = 0;
-        while (lv_info->wait_for_done && (count < 3))
+        while (lv_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
           {
              ecore_wl2_display_flush(_eflutil.wl.wl2_display);
              wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
@@ -834,7 +836,7 @@ efl_util_get_notification_window_level(Evas_Object *window,
         if (lv_info->wait_for_done)
           {
              int count = 0;
-             while ((lv_info->wait_for_done) && (count < 3))
+             while ((lv_info->wait_for_done) && (count < NUM_EVENT_WAIT_DONE_COUNT))
                {
                   ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
@@ -959,7 +961,7 @@ efl_util_set_window_screen_mode(Evas_Object *window,
         if (scr_mode_info->wait_for_done)
           {
              int count = 0;
-             while (scr_mode_info->wait_for_done && (count < 3))
+             while (scr_mode_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
                {
                   ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
@@ -1092,7 +1094,7 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
          if (brightness_info->wait_for_done)
            {
               int count = 0;
-              while (brightness_info->wait_for_done && (count < 3))
+              while (brightness_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
                 {
                    ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                    wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
@@ -1160,7 +1162,6 @@ efl_util_get_window_brightness(Evas_Object *window, int *brightness)
    return EFL_UTIL_ERROR_NONE;
 }
 
-
 struct _efl_util_inputgen_h
 {
    unsigned int init_type;
@@ -1168,8 +1169,6 @@ struct _efl_util_inputgen_h
    E_Devicemgr_Inputgen_Touch_Axis *axis_info;
 };
 
-/* LCOV_EXCL_STOP */
-
 static void
 _cb_device_add(void *data EINA_UNUSED,
                struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
@@ -1454,6 +1453,10 @@ efl_util_input_generate_touch(efl_util_inputgen_h inputgen_h, int idx,
    EINA_SAFETY_ON_FALSE_RETURN_VAL((x > 0 && y > 0), EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_FALSE_RETURN_VAL(inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, EFL_UTIL_ERROR_NO_SUCH_DEVICE);
 
+   if (_eflutil.wl.devmgr.request_touch_count != 0 &&
+       _eflutil.wl.devmgr.max_touch_count != _eflutil.wl.devmgr.request_touch_count)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
    if (idx >= _eflutil.wl.devmgr.max_touch_count)
      return EFL_UTIL_ERROR_INVALID_PARAMETER;