Enable double tap only if page is scalable.
authorEunmi Lee <eunmi15.lee@samsung.com>
Tue, 18 Jun 2013 08:47:38 +0000 (17:47 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 1 Jul 2013 06:10:13 +0000 (06:10 +0000)
[Title] Enable double tap only if page is scalable.
[Issue#] N/A
[Problem] The buttons of web applications which are implemented to use click event respond too slow.
[Cause] The click event is occured after 0.4 ms in order to check double tap.
[Solution] Actually, the double tap is not used in the page which is not scalable.
           So, disable double tap for non-scalable page and make click directly.

Change-Id: Idfccad41ad9ce9bec3cd55b1272263fc10af76cd

Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp
Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/tizen/GestureClient.cpp
Source/WebKit2/UIProcess/API/efl/tizen/GestureRecognizer.cpp
Source/WebKit2/UIProcess/API/efl/tizen/GestureRecognizer.h

index 2c605ce..e6d61d9 100755 (executable)
@@ -1391,10 +1391,18 @@ void EwkViewImpl::deleteDataList()
 }
 #endif
 
-#if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_GESTURE)
+#if ENABLE(TIZEN_GESTURE)
+#if ENABLE(TOUCH_EVENTS)
 void EwkViewImpl::feedTouchEventsByType(Ewk_Touch_Event_Type type)
 {
     feedTouchEvents(type);
 }
 #endif
+
+void EwkViewImpl::setDoubleTapEnabled(bool enabled)
+{
+    gestureRecognizer->setDoubleTapEnabled(enabled);
+}
+#endif
+
 #endif //#if OS(TIZEN)
index 02cd6cb..8c52c99 100755 (executable)
@@ -316,9 +316,11 @@ public:
     const WebCore::IntPoint scrollPosition() const { return m_scrollPosition; }
 #endif
 
-#if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_GESTURE)
+#if ENABLE(TIZEN_GESTURE)
+#if ENABLE(TOUCH_EVENTS)
     void feedTouchEventsByType(Ewk_Touch_Event_Type);
 #endif
+    void setDoubleTapEnabled(bool);
 #endif
 
     // FIXME: Make members private for encapsulation.
index e2da79b..e10ae50 100755 (executable)
@@ -400,6 +400,10 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
     double scaleRatioBeforeRotation = m_scaleFactor / m_viewportConstraints.minimumScale;
     m_viewportConstraints = computeViewportConstraints(attributes);
 
+#if ENABLE(TIZEN_GESTURE)
+    m_viewImpl->setDoubleTapEnabled(userScalable());
+#endif
+
     // Initially, m_scaleFactor is not decided yet.
     // So, we should update visible content rect at here.
     if (!m_scaleFactor) {
index 16e02aa..9386fdc 100755 (executable)
@@ -316,12 +316,7 @@ void GestureClient::endDoubleTap(const IntPoint& position)
         return;
     }
 
-    // Process Tap if current page is not scalable.
-    PageClientImpl::ViewportConstraints constraints = pageClientImpl->viewportConstraints();
-    if (constraints.userScalable && constraints.maximumScale - constraints.minimumScale > numeric_limits<float>::epsilon())
-        m_smartZoom->start(position.x(), position.y());
-    else
-        endTap(position);
+    m_smartZoom->start(position.x(), position.y());
 }
 
 void GestureClient::setZoomableArea(const IntPoint& target, const IntRect& area)
index 1218baf..cd477f4 100644 (file)
@@ -88,6 +88,17 @@ GestureRecognizer::~GestureRecognizer()
     evas_object_event_callback_del(m_viewWidget, EVAS_CALLBACK_MOUSE_UP, onMouseUp);
 }
 
+void GestureRecognizer::setDoubleTapEnabled(bool enabled)
+{
+    if (enabled)
+        elm_gesture_layer_double_tap_timeout_set(m_gestureObject, 0.4);
+    // FIXME: If double tap timeout is zero, the gesture_layer does not make tap and makes double tap without any delay.
+    // So, we have to set double tap timeout as small value to make tap and disable double tap.
+    // The value will be changed to zero when elm_gesture_layer works correctly.
+    else
+        elm_gesture_layer_double_tap_timeout_set(m_gestureObject, 0.00001);
+}
+
 void GestureRecognizer::initializeCallbacks()
 {
     // Add gesture callbacks.
index bfc673b..fae5bb6 100644 (file)
@@ -47,6 +47,8 @@ public:
     }
     ~GestureRecognizer();
 
+    void setDoubleTapEnabled(bool);
+
 private:
     explicit GestureRecognizer(Evas_Object*);
     void initializeCallbacks();