IME show properly after disappear the clipboard.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / efl / InputMethodContextEfl.cpp
index 9cfdc63..d810116 100755 (executable)
@@ -328,9 +328,13 @@ void InputMethodContextEfl::updateTextInputState()
     if (editor.shouldIgnoreCompositionSelectionChange)
         return;
 
-    if (editor.isContentEditable && m_useInputMethod)
+    if (editor.isContentEditable && m_useInputMethod) {
+#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
+        if (m_viewImpl->pageClient->isClipboardWindowOpened())
+            m_viewImpl->pageClient->closeClipboardWindow();
+#endif
         showIMFContext(editor);
-    else
+    else
         hideIMFContext();
 
     if (m_context)
@@ -537,13 +541,6 @@ void InputMethodContextEfl::showIMFContext(const EditorState& editor)
 #endif
 #endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
 
-#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
-    if (m_viewImpl->pageClient->isClipboardWindowOpened()) {
-        LOG(ISF, "[FAIL] Clipboard\n");
-        return;
-    }
-#endif
-
     bool hasFocus = evas_object_focus_get(m_viewImpl->view());
 
     if (!defaultKeypadEnabled) {
@@ -592,7 +589,8 @@ void InputMethodContextEfl::hideIMFContext()
 
     m_focused = false;
 
-    if (ecore_imf_context_input_panel_state_get(m_context.get()) != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
+    if (ecore_imf_context_input_panel_state_get(m_context.get()) != ECORE_IMF_INPUT_PANEL_STATE_HIDE
+        && evas_object_focus_get(m_viewImpl->view())) {
         ecore_imf_context_reset(m_context.get());
         ecore_imf_context_input_panel_hide(m_context.get());
         ecore_imf_context_focus_out(m_context.get());