Add debug information to ecore_wl2
authorch.jeong47 <ch.jeong47@samsung.com>
Thu, 9 Apr 2020 04:55:12 +0000 (13:55 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Fri, 17 Apr 2020 23:00:11 +0000 (08:00 +0900)
- add debug information which for analyzing of many issues related to touch event.
Sometimes we need more information regarding touch events of ecore_wl2.

Change-Id: I0c495c2b25fef7a6062febeddd43f7753a67e406
Signed-off-by: ch.jeong47 <ch.jeong47@samsung.com>
src/lib/ecore_wl2/ecore_wl2_input.c

index f4ac10f96cae171768f85865c4088a7ebf6beaec..f769de4917ce7cbb9aa7ecc13bbe83b816686aa4 100644 (file)
@@ -677,6 +677,10 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
           ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
      }
 
+   //TIZEN_ONLY(20200408): add debug
+   ERR("[press] window = %p, time=%u x=%d y=%d button=%d", window, (unsigned int)timestamp, ev->x, ev->y, device);
+   //
+
    ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev,
                    _input_event_mouse_button_cb_free, ev->dev);
 
@@ -752,6 +756,10 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window,
    else if ((input->focus.pointer) && (input->focus.pointer == window))
      ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
 
+   //TIZEN_ONLY(20200408): add debug
+   ERR("[release] time=%u x=%d y=%d button=%d", (unsigned int)timestamp, ev->x, ev->y, device);
+   //
+
    ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev,
                    _input_event_mouse_button_cb_free, ev->dev);
 
@@ -1479,6 +1487,10 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned
       code = _ecore_wl2_input_convert_old_keys(code);
 //
 
+   //TIZEN_ONLY(20200408): add debug
+   ERR("Key[%d] event occurs %u", code, timestamp);
+   //
+
    if (xkb_state_key_get_syms(input->xkb.state, code, &syms) == 1)
      sym = syms[0];
    if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
@@ -1642,11 +1654,22 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri
    Ecore_Wl2_Window *window;
 
    input = data;
-   if (!input) return;
-
+   //TIZEN_ONLY(20200408): add debug
+   if (!input)
+     {
+        ERR("input is NULL");
+        return;
+     }
+   //
    /* find the window which this surface belongs to */
    window = _ecore_wl2_display_window_surface_find(input->display, surface);
-   if (!window) return;
+   //TIZEN_ONLY(20200408): add debug
+   if (!window)
+     {
+        ERR("window is NULL");
+        return;
+     }
+   //
 
    input->focus.touch = window;
    input->timestamp = timestamp;
@@ -1689,10 +1712,21 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial
 {
    Ecore_Wl2_Input *input;
 
+   //TIZEN_ONLY(20200408): add debug
+   //if (!input) return;
+   //EINA_SAFETY_ON_NULL_RETURN(input->focus.touch); //if this is happening, then we are getting up events in a invalid state
    input = data;
-   if (!input) return;
-   EINA_SAFETY_ON_NULL_RETURN(input->focus.touch); //if this is happening, then we are getting up events in a invalid state
-
+   if (!input)
+     {
+        ERR("input is NULL");
+        return;
+     }
+   if (!input->focus.touch)
+     {
+        ERR("touch_focus is false");
+        return;
+     }
+   //
    input->timestamp = timestamp;
    input->display->serial = serial;
 
@@ -1715,9 +1749,20 @@ _touch_cb_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int ti
    Ecore_Wl2_Input *input;
 
    input = data;
-   if (!input) return;
-   if (!input->focus.touch) return;
-
+   //TIZEN_ONLY(20200408): add debug
+   //if (!input) return;
+   //if (!input->focus.touch) return;
+   if (!input)
+     {
+        ERR("input is NULL");
+        return;
+     }
+   if (!input->focus.touch)
+     {
+        ERR("touch_focus is false");
+        return;
+     }
+   //
    input->timestamp = timestamp;
    input->pointer.sx = wl_fixed_to_int(x);
    input->pointer.sy = wl_fixed_to_int(y);
@@ -1763,6 +1808,10 @@ _touch_cb_cancel(void *data, struct wl_touch *touch EINA_UNUSED)
 
    ev->dev = _ecore_wl2_touch_dev_get(input, ev->window);
 
+   //TIZEN_ONLY(20200408): add debug
+   ERR("[cancel] time=%u window=0x%x", ev->timestamp, ev->window);
+   //
+
    ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_CANCEL, ev, NULL, _input_event_mouse_button_cb_free);
 //
 }