From 1a04514baae14df1ee2f018d322817392273eb4a Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Thu, 7 Apr 2016 13:00:52 +0900 Subject: [PATCH] ecore_wayland: add last_device_class in Ecore_Wl_Input Ecore_Event_Mouse_XXX could be sent by ECORE_DEVICE_CLASS_MOUSE and ECORE_DEVICE_CLASS_TOUCH. Signed-off-by: Duna Oh Change-Id: I568a4abbd8bb2bf631f0c59c962d0a148ea9cc79 --- src/lib/ecore_wayland/ecore_wl_input.c | 13 +++++++------ src/lib/ecore_wayland/ecore_wl_private.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 6baff5a..55ad373 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -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; } diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h index 938c2d5..a0d6e12 100644 --- a/src/lib/ecore_wayland/ecore_wl_private.h +++ b/src/lib/ecore_wayland/ecore_wl_private.h @@ -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; -- 2.7.4