Fix timing issue between IME show and click operaton
authorTaeyun An <ty.an@samsung.com>
Mon, 8 Apr 2013 02:03:54 +0000 (11:03 +0900)
committerTaeyun An <ty.an@samsung.com>
Mon, 8 Apr 2013 02:03:54 +0000 (11:03 +0900)
[Title] Fix timing issue between IME show and click operaton
[Issue#] N_SE-32664
[Problem] IME disappear as soon as it appear when repeating click quickly
[Cause] the click operation happen even though IME is shown
[Solution] check the IME state and the position when clicking

Change-Id: Ib4fd6524798c773a4604bb9c7512c7b4732884f5

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h

index 9cc054c..fe300fa 100755 (executable)
@@ -535,6 +535,12 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
             if (impl->pageClient->isTextSelectionMode())
                 impl->pageClient->setIsTextSelectionMode(false);
 #endif
+
+#if ENABLE(TIZEN_ISF_PORT)
+            if (impl->inputMethodContext()->isIMEPostion(event->position.x, event->position.y))
+                return false;
+#endif
+
             impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
 #if ENABLE(TIZEN_ISF_PORT)
             evas_object_focus_set(smartData->self, true);
index 1fbe312..24d2a8e 100755 (executable)
@@ -36,6 +36,7 @@ InputMethodContextEfl::InputMethodContextEfl(EwkViewImpl* viewImpl, PassOwnPtr<E
     , m_focused(false)
 #if ENABLE(TIZEN_ISF_PORT)
     , m_tryToShow(false)
+    , m_state(ECORE_IMF_INPUT_PANEL_STATE_HIDE)
 #endif
 {
     ASSERT(context);
@@ -56,6 +57,8 @@ void InputMethodContextEfl::onIMFInputPanelStateChanged(void* data, Ecore_IMF_Co
 {
     InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
 
+    inputMethodContext->setState(state);
+
     if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
         if (inputMethodContext->m_viewImpl->pageClient->isClipboardWindowOpened())
@@ -75,6 +78,8 @@ void InputMethodContextEfl::onIMFInputPanelGeometryChanged(void* data, Ecore_IMF
     Eina_Rectangle rect;
     ecore_imf_context_input_panel_geometry_get(inputMethodContext->m_context.get(), &rect.x, &rect.y, &rect.w, &rect.h);
     evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "inputmethod,changed", &rect);
+
+    inputMethodContext->setIMERect(IntRect(rect.x, rect.y, rect.w, rect.h));
 }
 
 void InputMethodContextEfl::onIMFCandidatePanelStateChanged(void* data, Ecore_IMF_Context*, int state)
@@ -568,6 +573,14 @@ void InputMethodContextEfl::showInputPicker(Ewk_Input_Type type, const EditorSta
 }
 #endif
 
+bool InputMethodContextEfl::isIMEPostion(int x, int y)
+{
+    if (m_state == ECORE_IMF_INPUT_PANEL_STATE_SHOW)
+        return m_imeRect.contains(x, y);
+
+    return false;
+}
+
 #endif
 
 }
index 0bc13f5..28c31d1 100755 (executable)
@@ -59,6 +59,9 @@ public:
     void resetIMFContext();
     void hideIMFContext();
     void destroyIMFContextList();
+    bool isIMEPostion(int x, int y);
+    void setState(int state) { m_state = state; }
+    void setIMERect(const WebCore::IntRect& rect) { m_imeRect = rect; }
 #endif
 
 private:
@@ -84,6 +87,8 @@ private:
 
     HashMap<int, OwnPtr<Ecore_IMF_Context> > m_contextList;
     bool m_tryToShow;
+    int m_state;
+    WebCore::IntRect m_imeRect;
 #endif
 
     EwkViewImpl* m_viewImpl;