Fix keypad blinking issue
authorSangYong Park <sy302.park@samsung.com>
Thu, 11 Apr 2013 12:11:04 +0000 (21:11 +0900)
committerSangYong Park <sy302.park@samsung.com>
Thu, 11 Apr 2013 12:14:37 +0000 (21:14 +0900)
[Title] Fix keypad blinking issue
[Issue#] N_SE-33450 N_SE-33881
[Problem] Keypad did showing when ewk view has focus
[Cause] Ewk view has focus before handling tap event
[Solution] Set focus to ewk view after handling tap event

Change-Id: Ib4387c6024c71d474120a9ceb7180846aa9c1e9b

Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp
Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 596f44b..a8998c6 100755 (executable)
@@ -182,6 +182,9 @@ EwkViewImpl::EwkViewImpl(Evas_Object* view)
 #if USE(TILED_BACKING_STORE)
     , m_scaleFactor(1)
 #endif
+#if ENABLE(TIZEN_ISF_PORT)
+    , m_gestureTapState(GestureTapStateNone)
+#endif
 #endif // #if OS(TIZEN)
 {
     ASSERT(view);
index 02cd6cb..a36c492 100755 (executable)
@@ -319,6 +319,19 @@ public:
 #if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_GESTURE)
     void feedTouchEventsByType(Ewk_Touch_Event_Type);
 #endif
+
+#if ENABLE(TIZEN_ISF_PORT)
+    typedef enum {
+        GestureTapStateNone = 0x0,
+        GestureTapStateEnable = 0x1,
+        GestureTapStateDisable = 0x2,
+        GestureTapStateEndGesture = 0x4
+    } GestureTapState;
+
+    void initGestureTapState() { m_gestureTapState = GestureTapStateNone; }
+    void addGestureTapState(GestureTapState state) { m_gestureTapState |= state; }
+    unsigned gestureTapState() { return m_gestureTapState; }
+#endif
 #endif
 
     // FIXME: Make members private for encapsulation.
@@ -516,6 +529,10 @@ private:
     float m_scaleFactor;
     WebCore::IntPoint m_scrollPosition;
 #endif
+
+#if ENABLE(TIZEN_ISF_PORT)
+    unsigned m_gestureTapState;
+#endif
 #endif
 };
 
index 3ec0a0a..f1f1642 100755 (executable)
@@ -544,8 +544,11 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
 #endif
 
             impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
+
 #if ENABLE(TIZEN_ISF_PORT)
-            evas_object_focus_set(smartData->self, true);
+            impl->addGestureTapState(EwkViewImpl::GestureTapStateEndGesture);
+            if (impl->gestureTapState() == (EwkViewImpl::GestureTapStateDisable | EwkViewImpl::GestureTapStateEndGesture))
+                evas_object_focus_set(smartData->self, true);
 #endif
         } else if (event->count == 2)
             impl->gestureClient->endDoubleTap(IntPoint(event->position.x, event->position.y));
@@ -4081,6 +4084,10 @@ void ewk_view_touch_event_handler_result_set(Evas_Object* ewkView, WebKit::WebEv
         // to prevent applications scrolling at the beginning of touch.
         impl->wasHandledTouchMove = true;
         evas_object_smart_callback_call(ewkView, "touchmove,handled", static_cast<void*>(&impl->wasHandledTouchMove));
+
+#if ENABLE(TIZEN_ISF_PORT)
+        impl->initGestureTapState();
+#endif
     } else if (type == WebEvent::TouchMove) {
         impl->gestureClient->setMovingEnabled(!wasHandled);
 
@@ -4093,9 +4100,17 @@ void ewk_view_touch_event_handler_result_set(Evas_Object* ewkView, WebKit::WebEv
         if (impl->wasHandledTouchMove != wasHandled)
             evas_object_smart_callback_call(ewkView, "touchmove,handled", static_cast<void*>(&wasHandled));
         impl->wasHandledTouchMove = wasHandled;
-    } else if (type == WebEvent::TouchEnd && !impl->exceedTouchMoveThreshold && !wasHandled) {
-        impl->gestureClient->setMovingEnabled(!wasHandled);
-        impl->gestureClient->setTapEnabled(!wasHandled);
+    } else if (type == WebEvent::TouchEnd && !impl->exceedTouchMoveThreshold) {
+        if (!wasHandled) {
+            impl->gestureClient->setMovingEnabled(!wasHandled);
+            impl->gestureClient->setTapEnabled(!wasHandled);
+        }
+
+#if ENABLE(TIZEN_ISF_PORT)
+        impl->addGestureTapState(wasHandled ? EwkViewImpl::GestureTapStateDisable : EwkViewImpl::GestureTapStateEnable);
+        if (impl->gestureTapState() == (EwkViewImpl::GestureTapStateDisable | EwkViewImpl::GestureTapStateEndGesture))
+            evas_object_focus_set(ewkView, true);
+#endif
     }
 #endif
 }
index 48441c9..e8fa9cd 100755 (executable)
@@ -3773,6 +3773,10 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
         m_gestureEventQueue.removeFirst();
         m_pageClient->doneWithGestureEvent(event, handled);
 #endif
+#if ENABLE(TIZEN_ISF_PORT)
+        if (type == WebEvent::GestureSingleTap)
+            evas_object_focus_set(viewWidget(), true);
+#endif
         break;
     }
 #endif