pan: fix bugs to use correct x/y position when mouse button up 80/303080/1
authorduna.oh <duna.oh@samsung.com>
Fri, 27 Oct 2023 01:43:27 +0000 (10:43 +0900)
committerduna.oh <duna.oh@samsung.com>
Wed, 20 Dec 2023 01:30:05 +0000 (10:30 +0900)
Change-Id: I6e242e7f2fb205f6935de88481442d498203de26

src/e_mod_gesture_events.c

index b8a77d1..1cb26b0 100644 (file)
@@ -895,6 +895,7 @@ static void
 _e_gesture_pan_cancel(void)
 {
    E_Gesture_Event_Pan *pans = &gesture->gesture_events.pans;
+   Coords cur_point = {0,};
 
    if (pans->start_timer)
      {
@@ -908,9 +909,12 @@ _e_gesture_pan_cancel(void)
      }
 
    if (pans->state == E_GESTURE_PANPINCH_STATE_MOVING)
-     _e_gesture_pan_send(E_GESTURE_MODE_END, pans->num_pan_fingers, 0, 0,
-                         pans->fingers[pans->num_pan_fingers].res,
-                         pans->fingers[pans->num_pan_fingers].client);
+     {
+        _e_gesture_util_center_axis_get(pans->num_pan_fingers, &cur_point.x, &cur_point.y);
+        _e_gesture_pan_send(E_GESTURE_MODE_END, pans->num_pan_fingers, cur_point.x, cur_point.y,
+                            pans->fingers[pans->num_pan_fingers].res,
+                            pans->fingers[pans->num_pan_fingers].client);
+     }
 
    gesture->gesture_filter |= E_GESTURE_TYPE_PAN;
    pans->state = E_GESTURE_PANPINCH_STATE_DONE;
@@ -1622,9 +1626,8 @@ _e_gesture_process_mouse_button_up(void *event)
    if (!_e_gesture_process_touch_check(ev->dev, ev->multi.device))
      return E_GESTURE_EVENT_STATE_PROPAGATE;
 
-   gesture->gesture_events.base_point[ev->multi.device + 1].pressed = EINA_FALSE;
-   gesture->gesture_events.base_point[ev->multi.device + 1].axis.x = 0;
-   gesture->gesture_events.base_point[ev->multi.device + 1].axis.y = 0;
+   gesture->gesture_events.base_point[ev->multi.device + 1].axis.x = ev->x;
+   gesture->gesture_events.base_point[ev->multi.device + 1].axis.y = ev->y;
 
    if (!(gesture->gesture_filter & E_GESTURE_TYPE_EDGE_SWIPE))
      {
@@ -1647,6 +1650,10 @@ _e_gesture_process_mouse_button_up(void *event)
         _e_gesture_process_tap_up(ev);
      }
 
+   gesture->gesture_events.base_point[ev->multi.device + 1].pressed = EINA_FALSE;
+   gesture->gesture_events.base_point[ev->multi.device + 1].axis.x = 0;
+   gesture->gesture_events.base_point[ev->multi.device + 1].axis.y = 0;
+
    if (gesture->gesture_events.recognized_gesture)
      {
         if (gesture->gesture_events.num_pressed == 0)