From: JengHyun Kang Date: Fri, 10 Aug 2018 09:08:23 +0000 (+0900) Subject: e_input: set correct coords info following correct mt_slot X-Git-Tag: accepted/tizen/unified/20180820.153936~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25336890886a2545c451e5503d73c5bd99f2e53c;p=platform%2Fupstream%2Fenlightenment.git e_input: set correct coords info following correct mt_slot Change-Id: I48426afedc3c432c7664d6a71a74a43dffc036d0 --- diff --git a/src/bin/e_input_evdev.c b/src/bin/e_input_evdev.c index 5dd23da..fa2f944 100644 --- a/src/bin/e_input_evdev.c +++ b/src/bin/e_input_evdev.c @@ -979,6 +979,12 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_ edev->mt_slot = libinput_event_touch_get_slot(event); + if (edev->mt_slot < E_INPUT_MAX_SLOTS) + { + edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix; + edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy; + } + _device_handle_touch_motion_send(edev, event); _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN); } @@ -1012,6 +1018,12 @@ _device_handle_touch_motion(struct libinput_device *device, struct libinput_even edev->mt_slot = libinput_event_touch_get_slot(event); + if (edev->mt_slot < E_INPUT_MAX_SLOTS) + { + edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix; + edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy; + } + _device_handle_touch_motion_send(edev, event); } @@ -1026,6 +1038,15 @@ _device_handle_touch_up(struct libinput_device *device, struct libinput_event_to } edev->mt_slot = libinput_event_touch_get_slot(event); + + if (edev->mt_slot < E_INPUT_MAX_SLOTS) + { + edev->mouse.dx = edev->seat->ptr.dx = edev->seat->ptr.ix = + edev->touch.coords[edev->mt_slot].x; + edev->mouse.dy = edev->seat->ptr.dy = edev->seat->ptr.iy = + edev->touch.coords[edev->mt_slot].y; + } + _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP); } diff --git a/src/bin/e_input_private.h b/src/bin/e_input_private.h index 289d9cd..3fc4da6 100644 --- a/src/bin/e_input_private.h +++ b/src/bin/e_input_private.h @@ -16,6 +16,8 @@ extern struct xkb_context *cached_context; #define E_INPUT_ENV_LIBINPUT_LOG_DISABLE "E_INPUT_LIBINPUT_LOG_DISABLE" #define E_INPUT_ENV_LIBINPUT_LOG_EINA_LOG "E_INPUT_LIBINPUT_LOG_EINA_LOG" +#define E_INPUT_MAX_SLOTS 10 + struct _E_Input_Seat { const char *name; @@ -106,6 +108,11 @@ struct _E_Input_Evdev int x, y; int w, h; } transform; + struct + { + int x; + int y; + } coords[E_INPUT_MAX_SLOTS]; } touch; };