Fix for webkit event issue
authorhyun lee <hyunn.lee@samsung.com>
Tue, 22 Oct 2013 10:50:38 +0000 (19:50 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Tue, 22 Oct 2013 11:27:03 +0000 (20:27 +0900)
Change-Id: Ie7c74057bf34e5d5fa2f003812cf1105de05ce8d
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_GestureState.cpp
src/controls/FWebCtrl_Web.cpp
src/controls/FWebCtrl_Web.h

index 5bfa592..b2b3675 100755 (executable)
@@ -90,27 +90,6 @@ _TapGestureState::OnLongPressGestureDetected(_TouchLongPressGestureDetector& ges
        SysAssertf(pSmartData, "Failed to get webkit smart data.");
        pSmartData->api->gesture_move(const_cast< Ewk_View_Smart_Data* >(pSmartData), &gestureEvent);
 
-       //To delete magnifier
-       _TouchManager* pTouchManager = _TouchManager::GetInstance();
-       SysAssertf(pTouchManager, "Failed to get touch manager.");
-
-       Point absPoint(_CoordinateSystemUtils::ConvertToInteger(pTouchManager->GetPosition(pTouchManager->GetCurrentPointId())));
-
-       Ewk_Touch_Point* pPoint = static_cast< Ewk_Touch_Point* >(calloc(1, sizeof(Ewk_Touch_Point)));
-       pPoint->id = 0;
-       pPoint->x = absPoint.x;
-       pPoint->y = absPoint.y;
-       pPoint->state = EVAS_TOUCH_POINT_CANCEL;
-
-       Eina_List* pPointList = null;
-       pPointList = eina_list_append(pPointList, pPoint);
-
-       ewk_view_feed_touch_event(__pWebCore->GetWebNativeNode(), EWK_TOUCH_CANCEL, pPointList, null);
-
-       void* pData = null;
-       EINA_LIST_FREE(pPointList, pData)
-       free(pData);
-
        __longPressed = true;
 
        return true;
index b074756..8c268c8 100755 (executable)
@@ -347,6 +347,7 @@ _Web::_Web(void)
        , __previousTouchedPosition(0.0f, 0.0f)
        , __isFullScreenEntered(false)
        , __isRotated(false)
+       , __touchPressed(false)
 {
        SetBackgroundColor(Color(0, 0, 0, 0));
 }
@@ -719,6 +720,8 @@ _Web::SetEdgeReachedEvent(_WebEdgeType type)
 bool
 _Web::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo)
 {
+       __touchPressed = true;
+
        if (__pEflWebkit.get())
        {
                __edgeType = WEB_EDGE_NONE;
@@ -919,6 +922,8 @@ _Web::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo)
 bool
 _Web::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo)
 {
+       __touchPressed = false;
+
        SetFocused();
 
        if (__pEflWebkit.get())
@@ -1254,7 +1259,7 @@ _Web::SetFocusEnd(bool focus)
 
 
 bool
-_Web::IsFocusEnd(void)
+_Web::IsFocusEnd(void) const
 {
        return __focus;
 }
@@ -1323,4 +1328,38 @@ _Web::OnDrawFocus(void)
 }
 
 
+bool
+_Web::OnFocusLost(const _Control& source)
+{
+       _Control::OnFocusLost(*this);
+
+       if (__touchPressed == true)
+       {
+               _TouchManager* pTouchManager = _TouchManager::GetInstance();
+               SysAssertf(pTouchManager, "Failed to get touch manager.");
+
+               Point absPoint(_CoordinateSystemUtils::ConvertToInteger(pTouchManager->GetPosition(pTouchManager->GetCurrentPointId())));
+
+               Ewk_Touch_Point* pPoint = static_cast< Ewk_Touch_Point* >(calloc(1, sizeof(Ewk_Touch_Point)));
+               pPoint->id = 0;
+               pPoint->x = absPoint.x;
+               pPoint->y = absPoint.y;
+               pPoint->state = EVAS_TOUCH_POINT_CANCEL;
+
+               Eina_List* pPointList = null;
+               pPointList = eina_list_append(pPointList, pPoint);
+
+               ewk_view_feed_touch_event(GetWebNativeNode(), EWK_TOUCH_CANCEL, pPointList, null);
+
+               void* pData = null;
+               EINA_LIST_FREE(pPointList, pData)
+               free(pData);
+
+               __touchPressed = false;
+       }
+
+       return false;
+}
+
+
 }}} // Tizen::Web::Controls
index aaec2cc..be00cbc 100755 (executable)
@@ -120,7 +120,8 @@ public:
        void SetFullScreenEntered(bool isFullScreenEntered);
 
        void SetFocusEnd(bool focus);
-       bool IsFocusEnd(void);
+
+       bool IsFocusEnd(void) const;
 
        bool CanOutOfEdgeLeft(float scrollDistanceX, int pageDistance);
        bool CanOutOfEdgeRight(float scrollDistanceX, int pageDistance);
@@ -159,6 +160,7 @@ public:
        virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo);
        virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo);
        virtual void OnDrawFocus(void);
+       virtual bool OnFocusLost(const Tizen::Ui::_Control& source);
 
 private:
        _Web(const _Web& value);
@@ -215,6 +217,8 @@ private:
        bool __isFullScreenEntered;
 
        bool __isRotated;
+
+       bool __touchPressed;
 }; // _Web
 
 }}} // Tizen::Web::Controls