From 2e49e20e312f0da1b7fcb7cbf28e540ac795a3e6 Mon Sep 17 00:00:00 2001 From: Yuni Jeong Date: Fri, 28 Jun 2013 02:46:37 +0900 Subject: [PATCH] Fixed sometimes foucs ring disappear late and is not shown. [Title] Fixed sometimes foucs ring disappear late and is not shown. [Issue#] N/A [Problem] 1. Sometimes focus ring disappear after loading new page. 2. Sometimes focus ring is not shown. [Cause] 1. After new page was loaded, timer for hidding focus ring expire. So, focus ring disappear late. 2. After new page was loaded, timer for showing focus ring expire. And then, to getting focus ring node is performed at new page. [Solution] 1. When new load is commited, added code to hide focus ring immediately. 2. If focus ring is not showing just before tap is performed, added code to show focus ring immediately. Change-Id: I9e65f9dc8231038722ec45995a5207880fd76035 --- Source/WebKit2/UIProcess/API/efl/ewk_view.cpp | 4 ++++ Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp | 17 ++++++++++++++++- Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h | 2 +- Source/WebKit2/UIProcess/WebPageProxy.cpp | 12 +++++++++++- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index f154f52..1404830 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -1992,6 +1992,10 @@ void ewkViewLoadCommitted(Evas_Object* ewkView) EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl); impl->gestureClient->reset(); #endif +#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) + if (impl->focusRing) + impl->focusRing->hide(); +#endif #if ENABLE(TIZEN_ISF_PORT) impl->inputMethodContext()->hideIMFContext(); #endif diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp index cba19d7..fad2579 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp @@ -74,11 +74,26 @@ void FocusRing::setImage(const String& path, int outerWidth, int innerWidth) } } -void FocusRing::requestToShow(const IntPoint& position) +void FocusRing::requestToShow(const IntPoint& position, bool immediately) { if (!m_imagePath.isNull()) return; + if (immediately) { + if (m_focusRingObject && evas_object_visible_get(m_focusRingObject)) + return; + else { + if (m_showTimer) { + ecore_timer_del(m_showTimer); + m_showTimer = 0; + } + + m_position = position; + show(IntRect()); + return; + } + } + m_position = position; if (m_showTimer) diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h b/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h index f15a6c2..802b3dc 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h +++ b/Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h @@ -40,7 +40,7 @@ public: void setImage(const String&, int, int); - void requestToShow(const WebCore::IntPoint&); + void requestToShow(const WebCore::IntPoint&, bool immediately = false); void requestToHide(bool immediately = false); void show(const WebCore::IntRect&, const bool includeOnlyImage = false); diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index 4bf24b0..cf2c174 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -1259,11 +1259,21 @@ void WebPageProxy::handleGestureEvent(const WebGestureEvent& event) if (!isValid()) return; -#if ENABLE(TIZEN_ISF_PORT) +#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_FOCUS_RING) if (event.type() == WebEvent::GestureSingleTap) { +#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) + FocusRing* focusRing = ewkViewGetFocusRing(viewWidget()); + if (focusRing) { + IntPoint tapPosition = EwkViewImpl::fromEvasObject(viewWidget())->transformToScene().mapPoint(event.position()); + focusRing->requestToShow(tapPosition, true); + } +#endif + +#if ENABLE(TIZEN_ISF_PORT) InputMethodContextEfl* inputMethodContext = static_cast(m_pageClient)->viewImpl()->inputMethodContext(); if (inputMethodContext) inputMethodContext->resetIMFContext(); +#endif } #endif -- 2.7.4