Provides simpler and less vulnerable filtration of unwanted mouse events while dragging 30/282430/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/hotfix/20221116.110023 accepted/tizen/unified/20221007.101812 tizen_7.0_m2_release
authorLukasz Oleksak <l.oleksak@samsung.com>
Thu, 29 Sep 2022 10:18:42 +0000 (12:18 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Mon, 3 Oct 2022 09:28:09 +0000 (11:28 +0200)
Fixes: https://review.tizen.org/gerrit/#/c/platform/core/uifw/e-mod-tizen-screen-reader/+/282157/

Change-Id: I03ecc5632bc4781798c3ede14b0bbf180a60f430

src/e_screen_reader_gestures.c

index 8a6a848..fbda135 100644 (file)
@@ -91,7 +91,6 @@ struct _Cover
         Eina_Bool double_tap;
         Ecore_Event_Mouse_Button *ev_down, *ev_multi_down;
         Eina_Bool drag_start;
-        int drag_finger[2];
         int drag_x_delta;
         int drag_y_delta;
    } tap_n_hold_gesture_data;
@@ -1020,8 +1019,6 @@ _hover_event_emit(Cover *cov, gesture_state_e state)
           }
         _emit_mouse_move_event(cov->tap_n_hold_gesture_data.ev_down);
         cov->tap_n_hold_gesture_data.ev_down->multi.radius += MAGIC_NUMBER;
-        cov->tap_n_hold_gesture_data.drag_finger[0] = cov->hover_gesture.finger[0];
-        cov->tap_n_hold_gesture_data.drag_finger[1] = cov->hover_gesture.finger[1];
         cov->tap_n_hold_gesture_data.drag_start = EINA_TRUE;
         ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, cov->tap_n_hold_gesture_data.ev_down, NULL, NULL);
         if (cov->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
@@ -1299,8 +1296,6 @@ _tap_gestures_mouse_down(Ecore_Event_Mouse_Button *ev, Cover *cov)
          cov->tap_n_hold_gesture_data.n_taps = 1;
          cov->tap_n_hold_gesture_data.double_tap = EINA_FALSE;
          cov->tap_n_hold_gesture_data.drag_start = EINA_FALSE;
-         cov->tap_n_hold_gesture_data.drag_finger[0] = -1;
-         cov->tap_n_hold_gesture_data.drag_finger[1] = -1;
          if (!(cov->tap_n_hold_gesture_data.ev_down = malloc(sizeof(Ecore_Event_Mouse_Button))))
            {
               DEBUG("NOT ENOUGH MEMORY");
@@ -1476,10 +1471,8 @@ static Eina_Bool
 _mouse_move(int type, Ecore_Event_Mouse_Move *event)
 {
    Ecore_Event_Mouse_Move *ev = event;
-   // During draging ignore events from other fingers than the fingers that initiated the drag
-   if (cover->tap_n_hold_gesture_data.drag_start &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[0] &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[1])
+   // During draging ignore events from other fingers than the finger that initiated the drag
+   if (cover->tap_n_hold_gesture_data.drag_start && ev->multi.device > 0)
      {
         return EINA_FALSE;
      }
@@ -1550,10 +1543,8 @@ _mouse_button_up(int type, Ecore_Event_Mouse_Button *event)
         event->multi.radius -= MAGIC_NUMBER;
         return EINA_TRUE;
      }
-   // During draging ignore events from other fingers than the fingers that initiated the drag
-   if (cover->tap_n_hold_gesture_data.drag_start &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[0] &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[1])
+   // During draging ignore events from other fingers than the finger that initiated the drag
+   if (cover->tap_n_hold_gesture_data.drag_start && ev->multi.device > 0)
      {
         return EINA_FALSE;
      }
@@ -1585,8 +1576,6 @@ _mouse_button_up(int type, Ecore_Event_Mouse_Button *event)
              ev_multi_up->multi.device = 1;
              ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev_multi_up, NULL, NULL);
           }
-        cover->tap_n_hold_gesture_data.drag_finger[0] = -1;
-        cover->tap_n_hold_gesture_data.drag_finger[1] = -1;
         cover->tap_n_hold_gesture_data.drag_start = EINA_FALSE;
         g_context->highlighted_object_x = -1;
         g_context->highlighted_object_y = -1;
@@ -1618,10 +1607,8 @@ _mouse_button_down(int type, Ecore_Event_Mouse_Button *event)
         ev->multi.radius -= MAGIC_NUMBER;
         return EINA_TRUE;
      }
-   // During draging ignore events from other fingers than the fingers that initiated the drag
-   if (cover->tap_n_hold_gesture_data.drag_start &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[0] &&
-       ev->multi.device != cover->tap_n_hold_gesture_data.drag_finger[1])
+   // During draging ignore events from other fingers than the finger that initiated the drag
+   if (cover->tap_n_hold_gesture_data.drag_start && ev->multi.device > 0)
      {
         return EINA_FALSE;
      }