Fix gestures with m39
authorBalazs Kelemen <b.kelemen@samsung.com>
Thu, 25 Sep 2014 18:51:35 +0000 (14:51 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Chromium doesn't handle or want to see touch-still (i.e. EVAS_TOUCH_POINT_STILL)
events. In debug it leads to a NOTREACHED in aura code, in release it confuses
the gesture handler so it doesn't function correctly. It seems like we can
simply ignore these events.

Note that this doesn't solve the bringup of impl level touch features such as
selection or overscroll effect.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=5593

Change-Id: Ia8fe780d2ca507481641ee0ce9feb497783cfc7d
Signed-off-by: Balazs Kelemen <b.kelemen@samsung.com>
tizen_src/impl/browser/renderer_host/web_event_factory_efl.cc
tizen_src/impl/browser/renderer_host/web_event_factory_efl.h
tizen_src/impl/eweb_view.cc

index 5b771b2a9db10e5b92769273719941aceca730d5..de983636a0396c4f6af659a55c2c6873baf91dd6 100644 (file)
@@ -318,14 +318,15 @@ static ui::EventType EvasTouchEventTypeToUI(Evas_Touch_Point_State evas_touch) {
       return ui::ET_TOUCH_RELEASED;
     case EVAS_TOUCH_POINT_CANCEL:
       return ui::ET_TOUCH_CANCELLED;
-    case EVAS_TOUCH_POINT_STILL: // No equivalent in chromium M35+
+    case EVAS_TOUCH_POINT_STILL:
+      // Not handled by chromium, should not be passed here.
     default:
+      NOTREACHED();
       return ui::ET_UNKNOWN;
   }
-
 }
 
-ui::TouchEvent WebEventFactoryEfl::toUITouchEvent(tizen_webview::Touch_Point* p, Evas_Object* web_view, float scale_factor) {
+ui::TouchEvent WebEventFactoryEfl::toUITouchEvent(const tizen_webview::Touch_Point* p, Evas_Object* web_view, float scale_factor) {
   int x = p->x, y = p->y;
 
   TranslateEvasCoordToWebKitCoord(web_view, x, y);
index f72f44d3d208e3e043baad967ffea2137eb22362..082d6c0481d1f8d3a1fa66959e8a1206bab59210 100644 (file)
@@ -42,7 +42,7 @@ class WebEventFactoryEfl {
   static content::NativeWebKeyboardEvent toWebKeyboardEvent(Evas*, const Evas_Event_Key_Down*);
   static content::NativeWebKeyboardEvent toWebKeyboardEvent(Evas*, const Evas_Event_Key_Up*);
 
-  static ui::TouchEvent toUITouchEvent(tizen_webview::Touch_Point*, Evas_Object* evas_object, float scale_factor);
+  static ui::TouchEvent toUITouchEvent(const tizen_webview::Touch_Point*, Evas_Object* evas_object, float scale_factor);
 };
 
 }
index 51d30e25c11d610e78384373e0e3986ccb419b58..911217fa2a218e3395ac1b726210d694c3f23bef 100644 (file)
@@ -572,7 +572,12 @@ void EWebView::HandleTouchEvents(tizen_webview::Touch_Event_Type type, const Ein
   const Eina_List* l;
   void* data;
   EINA_LIST_FOREACH(points, l, data) {
-    ui::TouchEvent touch_event = WebEventFactoryEfl::toUITouchEvent(static_cast<tizen_webview::Touch_Point*>(data), evas_object(), rwhv()->device_scale_factor());
+    const tizen_webview::Touch_Point* point = reinterpret_cast<tizen_webview::Touch_Point*>(data);
+    if (point->state == EVAS_TOUCH_POINT_STILL) {
+      // Chromium doesn't expect (and doesn't like) these events.
+      continue;
+    }
+    ui::TouchEvent touch_event = WebEventFactoryEfl::toUITouchEvent(point, evas_object(), rwhv()->device_scale_factor());
     rwhv()->HandleTouchEvent(&touch_event);
   }
 }