ecore_wayland: add last_device_class in Ecore_Wl_Input 29/65029/1 accepted/tizen/common/20160408.184800 accepted/tizen/ivi/20160407.110905 accepted/tizen/mobile/20160407.110811 accepted/tizen/tv/20160407.110830 accepted/tizen/wearable/20160407.110845 submit/tizen/20160407.042041
authorDuna Oh <duna.oh@samsung.com>
Thu, 7 Apr 2016 04:00:52 +0000 (13:00 +0900)
committerDuna Oh <duna.oh@samsung.com>
Thu, 7 Apr 2016 04:04:44 +0000 (13:04 +0900)
Ecore_Event_Mouse_XXX could be sent by ECORE_DEVICE_CLASS_MOUSE and ECORE_DEVICE_CLASS_TOUCH.

Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I568a4abbd8bb2bf631f0c59c962d0a148ea9cc79

src/lib/ecore_wayland/ecore_wl_input.c
src/lib/ecore_wayland/ecore_wl_private.h

index 6baff5a..55ad373 100644 (file)
@@ -1491,7 +1491,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
    ev->multi.y = input->sy;
    ev->multi.root.x = input->sx;
    ev->multi.root.y = input->sy;
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, input->last_device_class);
 
    if ((down_info = _ecore_wl_mouse_down_info_get(device)))
      {
@@ -1521,7 +1521,7 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
    ev->y = input->sy;
    ev->modifiers = input->modifiers;
    ev->timestamp = timestamp;
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, input->last_device_class);
 
    if (win)
      {
@@ -1545,7 +1545,7 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
    ev->y = input->sy;
    ev->modifiers = input->modifiers;
    ev->timestamp = timestamp;
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, input->last_device_class);
 
    if (win)
      {
@@ -1683,7 +1683,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
    ev->multi.y = input->sy;
    ev->multi.root.x = input->sx;
    ev->multi.root.y = input->sy;
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, input->last_device_class);
 
    if (win)
      {
@@ -1759,7 +1759,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int d
    ev->multi.angle = 0.0;
    ev->multi.root.x = input->sx;
    ev->multi.root.y = input->sy;
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name,  input->last_device_class);
 
    if (device < ECORE_WL_TOUCH_MAX)
      {
@@ -1793,7 +1793,7 @@ _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int v
    ev->y = input->sy;
    /* ev->root.x = input->sx; */
    /* ev->root.y = input->sy; */
-   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = _ecore_wl_input_get_ecore_device(input->last_device_name,  input->last_device_class);
 
    if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
      {
@@ -2119,6 +2119,7 @@ _ecore_wl_input_device_cb_event_device(void *data, struct tizen_input_device *ti
    if (!(dev = data)) return;
    if (!dev->identifier) return;
    eina_stringshare_replace(&input->last_device_name, dev->identifier);
+   input->last_device_class = _ecore_wl_input_cap_to_ecore_device_class(dev->clas);
 
    return;
 }
index 938c2d5..a0d6e12 100644 (file)
@@ -268,6 +268,7 @@ struct _Ecore_Wl_Input
 
    Eina_List *devices;
    const char *last_device_name;
+   Ecore_Device_Class last_device_class;
 
    const char *cursor_name;
    struct wl_cursor *cursor;