e_comp_wl: print logs about mouse down/up events 04/311204/2
authorduna.oh <duna.oh@samsung.com>
Thu, 16 May 2024 02:14:37 +0000 (11:14 +0900)
committerDuna Oh <duna.oh@samsung.com>
Thu, 16 May 2024 04:26:08 +0000 (04:26 +0000)
Change-Id: I7631390a78f503fd7315608c53f136160598d6bc

src/bin/e_comp_wl.c

index 6c0c471..157d911 100644 (file)
@@ -772,7 +772,6 @@ _e_comp_wl_send_touch_cancel(E_Client *ec)
    Eina_List *l;
    struct wl_resource *res;
    struct wl_client *wc;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -783,15 +782,12 @@ _e_comp_wl_send_touch_cancel(E_Client *ec)
 
    wc = wl_resource_get_client(surface);
 
-   comp_conf = e_comp_config_get();
-
    EINA_LIST_FOREACH(e_comp->wl_comp_data->touch.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (!e_comp_wl_input_touch_check(res)) continue;
 
-        if (comp_conf && comp_conf->input_log_enable)
-           ELOGF("Touch", "Cancel name:%20s", ec, e_client_util_name_get(ec));
+        ELOGF("Touch", "Cancel name:%20s", ec, e_client_util_name_get(ec));
 
         wl_touch_send_cancel(res);
      }
@@ -1373,7 +1369,6 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
    struct wl_resource *res;
    wl_fixed_t x, y;
    uint32_t serial;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -1391,8 +1386,6 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
         y = wl_fixed_from_int(canvas_y - ec->client.y);
      }
 
-   comp_conf = e_comp_config_get();
-
    EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
@@ -1400,15 +1393,13 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
         TRACE_INPUT_BEGIN(_e_comp_wl_send_touch);
         if (pressed)
           {
-             if (comp_conf && comp_conf->input_log_enable)
-               ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d, name:%20s)", ec, idx, timestamp, canvas_x - ec->client.x, canvas_y - ec->client.y, e_client_util_name_get(ec));
+             ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d, name:%20s)", ec, idx, timestamp, canvas_x - ec->client.x, canvas_y - ec->client.y, e_client_util_name_get(ec));
 
              wl_touch_send_down(res, serial, timestamp, surface, idx, x, y); //id 0 for the 1st finger
           }
         else
           {
-             if (comp_conf && comp_conf->input_log_enable)
-               ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d, name:%20s)\n", ec, idx, timestamp, canvas_x - ec->client.x, canvas_y - ec->client.y, e_client_util_name_get(ec));
+             ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d, name:%20s)\n", ec, idx, timestamp, canvas_x - ec->client.x, canvas_y - ec->client.y, e_client_util_name_get(ec));
 
              wl_touch_send_up(res, serial, timestamp, idx);
           }
@@ -1587,7 +1578,6 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    Evas_Device *dev = NULL;
    const Evas_Device *seat_dev;
    const char *dev_name, *seat_name;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -1599,11 +1589,9 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    seat_dev = evas_device_parent_get(dev);
    seat_name = evas_device_name_get(seat_dev);
 
-   comp_conf = e_comp_config_get();
-   if (comp_conf && comp_conf->input_log_enable)
-     ELOGF("Touch", "Down (obj: %p, button: %d, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
-           ec, obj, ev->button, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
-           dev_name, seat_name);
+   ELOGF("Mouse", "Down (obj: %p, button: %d, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
+         ec, obj, ev->button, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
+         dev_name, seat_name);
 
    _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
 
@@ -1645,7 +1633,6 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *even
    const Evas_Device *seat_dev;
    const char *dev_name, *seat_name;;
    Evas_Event_Flags flags;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (ec->cur_mouse_action) return;
@@ -1664,11 +1651,9 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *even
    seat_name = evas_device_name_get(seat_dev);
    flags = evas_event_default_flags_get(evas);
 
-   comp_conf = e_comp_config_get();
-   if (comp_conf && comp_conf->input_log_enable)
-     ELOGF("Touch", "Up (obj: %p, button: %d, flag: 0x%x, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
-           ec, obj, ev->button, flags, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
-           dev_name, seat_name);
+   ELOGF("Mouse", "Up (obj: %p, button: %d, flag: 0x%x, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
+         ec, obj, ev->button, flags, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
+         dev_name, seat_name);
 
    if (dev && (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_TOUCH))
      {
@@ -1783,7 +1768,6 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    const Evas_Device *seat_dev;
    const char *dev_name, *seat_name;
    Evas_Device_Class dev_class;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -1802,11 +1786,9 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
    seat_dev = evas_device_parent_get(dev);
    seat_name = evas_device_name_get(seat_dev);
 
-   comp_conf = e_comp_config_get();
-   if (comp_conf && comp_conf->input_log_enable)
-     ELOGF("Touch", "Down (obj: %p, idx: %d, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
-           ec, obj, ev->device, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
-           dev_name, seat_name);
+   ELOGF("Touch", "Down (obj: %p, idx: %d, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
+         ec, obj, ev->device, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
+         dev_name, seat_name);
 
    if (dev && dev_name)
      {
@@ -1829,7 +1811,6 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas, Evas_Object *obj EINA_UNUSED
    const char *dev_name, *seat_name;
    Evas_Device_Class dev_class;
    Evas_Event_Flags flags;
-   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -1855,11 +1836,9 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas, Evas_Object *obj EINA_UNUSED
    seat_dev = evas_device_parent_get(dev);
    seat_name = evas_device_name_get(seat_dev);
 
-   comp_conf = e_comp_config_get();
-   if (comp_conf && comp_conf->input_log_enable)
-     ELOGF("Touch", "Up (obj: %p, idx: %d, flag: 0x%x, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
-           ec, obj, ev->device, flags, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
-           dev_name, seat_name);
+   ELOGF("Touch", "Up (obj: %p, idx: %d, flag: 0x%x, time: %d, x:%d, y:%d, name:%20s) (dev:%s, seat:%s)",
+         ec, obj, ev->device, flags, ev->timestamp, ev->output.x, ev->output.y, e_client_util_name_get(ec),
+         dev_name, seat_name);
 
    if (dev && dev_name)
      {
@@ -4538,10 +4517,13 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
    struct wl_client *wc;
    uint32_t serial, btn;
    struct wl_resource *res;
-   E_Comp_Config *comp_conf = NULL;
 
-   if (ec->cur_mouse_action || e_comp_wl->drag)
-     return EINA_FALSE;
+   if (ec->cur_mouse_action) return EINA_FALSE;
+   if (e_comp_wl->drag)
+     {
+        ELOGF("Mouse", "Button %s ignored. dragging. (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), button_id, timestamp);
+        return EINA_FALSE;
+     }
    if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
    if ((ec->ignored) && (!ec->remote_surface.provider)) return EINA_FALSE;
 
@@ -4563,16 +4545,13 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
    wc = wl_resource_get_client(surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
-   comp_conf = e_comp_config_get();
-
    EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (!e_comp_wl_input_pointer_check(res)) continue;
         TRACE_INPUT_BEGIN(e_comp_wl_evas_handle_mouse_button);
 
-        if (comp_conf && comp_conf->input_log_enable)
-          ELOGF("Mouse", "Button %s (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), btn, timestamp);
+        ELOGF("Mouse", "Button %s (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), btn, timestamp);
 
         wl_pointer_send_button(res, serial, timestamp, btn, state);
         TRACE_INPUT_END();