e_input: set correct coords info following correct mt_slot 50/186550/1
authorJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 10 Aug 2018 09:08:23 +0000 (18:08 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 10 Aug 2018 09:08:23 +0000 (18:08 +0900)
Change-Id: I48426afedc3c432c7664d6a71a74a43dffc036d0

src/bin/e_input_evdev.c
src/bin/e_input_private.h

index 5dd23da..fa2f944 100644 (file)
@@ -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);
 }
 
index 289d9cd..3fc4da6 100644 (file)
@@ -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;
 };