Fix input picker issue
authorSangYong Park <sy302.park@samsung.com>
Tue, 23 Apr 2013 20:56:25 +0000 (05:56 +0900)
committerSangYong Park <sy302.park@samsung.com>
Tue, 23 Apr 2013 21:05:37 +0000 (06:05 +0900)
[Title] Fix input picker issue
[Issue#] N_SE-35884
[Problem] Do not showing input picker by tap after hiding input picker.
[Cause] showInputPicker() was called before ewk view has focus.
[Solution] call showInputPicker() when ewk view has focus.

Change-Id: I97de35a63f884b55ae02c011f57bba648f049115

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

index e9decb1..207b011 100755 (executable)
@@ -37,6 +37,7 @@ InputMethodContextEfl::InputMethodContextEfl(EwkViewImpl* viewImpl, PassOwnPtr<E
 #if ENABLE(TIZEN_ISF_PORT)
     , m_useInputMethod(false)
     , m_state(ECORE_IMF_INPUT_PANEL_STATE_HIDE)
+    , m_inputPickerType(-1)
 #endif
 {
     ASSERT(context);
@@ -437,6 +438,11 @@ Ecore_IMF_Autocapital_Type InputMethodContextEfl::autoCapitalType()
 
 void InputMethodContextEfl::onFocusIn()
 {
+    if (m_inputPickerType >= 0) {
+        showInputPicker(m_viewImpl->page()->editorState());
+        return;
+    }
+
     if (!m_context || !m_focused)
         return;
 
@@ -489,23 +495,23 @@ void InputMethodContextEfl::showIMFContext(const EditorState& editor)
     bool defaultKeypadEnabled = ewk_settings_default_keypad_enabled_get(settings);
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-    if (editor.inputMethodHints == "date") {
-        showInputPicker(EWK_INPUT_TYPE_DATE, editor);
-        return;
-    } else if (editor.inputMethodHints == "datetime") {
-        showInputPicker(EWK_INPUT_TYPE_DATETIME, editor);
-        return;
-    } else if (editor.inputMethodHints == "datetime-local") {
-        showInputPicker(EWK_INPUT_TYPE_DATETIMELOCAL, editor);
-        return;
-    } else if (editor.inputMethodHints == "month") {
-        showInputPicker(EWK_INPUT_TYPE_MONTH, editor);
-        return;
-    } else if (editor.inputMethodHints == "time") {
-        showInputPicker(EWK_INPUT_TYPE_TIME, editor);
-        return;
-    } else if (editor.inputMethodHints == "week") {
-        showInputPicker(EWK_INPUT_TYPE_WEEK, editor);
+    if (editor.inputMethodHints == "date")
+        m_inputPickerType = EWK_INPUT_TYPE_DATE;
+    else if (editor.inputMethodHints == "datetime")
+        m_inputPickerType = EWK_INPUT_TYPE_DATETIME;
+    else if (editor.inputMethodHints == "datetime-local")
+        m_inputPickerType = EWK_INPUT_TYPE_DATETIMELOCAL;
+    else if (editor.inputMethodHints == "month")
+        m_inputPickerType = EWK_INPUT_TYPE_MONTH;
+    else if (editor.inputMethodHints == "time")
+        m_inputPickerType = EWK_INPUT_TYPE_TIME;
+    else if (editor.inputMethodHints == "week")
+        m_inputPickerType = EWK_INPUT_TYPE_WEEK;
+    else
+        m_inputPickerType = -1;
+
+    if (m_inputPickerType >= 0) {
+        showInputPicker(editor);
         return;
     }
 
@@ -575,6 +581,8 @@ void InputMethodContextEfl::hideIMFContext()
     }
 #endif
 
+    m_inputPickerType = -1;
+
     if (!m_context || !m_focused)
         return;
 
@@ -598,12 +606,13 @@ void InputMethodContextEfl::destroyIMFContextList()
 }
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-void InputMethodContextEfl::showInputPicker(Ewk_Input_Type type, const EditorState& editorState)
+void InputMethodContextEfl::showInputPicker(const EditorState& editorState)
 {
     if (editorState.selectionIsRange || !evas_object_focus_get(m_viewImpl->view()))
         return;
 
-    ewkViewInputPickerRequest(m_viewImpl->view(), type, editorState.surroundingText);
+    ewkViewInputPickerRequest(m_viewImpl->view(), static_cast<Ewk_Input_Type>(m_inputPickerType), editorState.surroundingText);
+    m_inputPickerType = -1;
 }
 #endif
 
index a8f45a7..2da5645 100755 (executable)
@@ -85,7 +85,7 @@ private:
     void setIMERect(const WebCore::IntRect& rect) { m_imeRect = rect; }
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-    void showInputPicker(Ewk_Input_Type, const EditorState&);
+    void showInputPicker(const EditorState&);
 #endif
 #endif
 
@@ -98,6 +98,7 @@ private:
     bool m_useInputMethod;
     int m_state;
     WebCore::IntRect m_imeRect;
+    int m_inputPickerType;
 #endif
 };