Fixed handes and context menu for text selection are disaplyed twice after changing...
authorYuni Jeong <yhnet.jung@samsung.com>
Wed, 11 Sep 2013 08:41:12 +0000 (17:41 +0900)
committerTaeyun An <ty.an@samsung.com>
Thu, 10 Oct 2013 07:51:21 +0000 (16:51 +0900)
[Title] Fixed handes and context menu for text selection are disaplyed twice after changing font size in email app.
[Issue#] P130812-03666
[Problem] Handes and context menu for text selection are disaplyed twice after changing font size in email app.
[Cause] After changing font size, IME is shown.
        When IME is shown, "dismissed" callback function for context menu is called.
        And then, context menu is hidden and context menu is shown again.
[Solution] If IME stats is "will show" when webkit try to display context menu,
           delayed to display context menu.

Change-Id: I8e986beb9319c4402ad9ddc2b23e84a96dbc4273

Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h

index 7b25e6a..8fa0d9d 100755 (executable)
@@ -33,6 +33,7 @@
 #include "NativeWebMouseEvent.h"
 #include "ewk_view.h"
 #include <Elementary.h>
+#include "InputMethodContextEfl.h"
 
 using namespace WebCore;
 
@@ -136,10 +137,8 @@ void TextSelection::update()
                 setIsTextSelectionMode(false);
             }
         } else {
-            if (!isTextSelectionDowned() && !isTextSelectionHandleDowned()) {
-                updateHandlers();
-                showContextMenu();
-            }
+            if (!isTextSelectionDowned() && !isTextSelectionHandleDowned())
+                requestToShow();
         }
         return;
     }
@@ -545,10 +544,10 @@ void TextSelection::updateHandlesAndContextMenu(bool isShow, bool isScrolling)
         return;
     }
 
-    if (m_viewImpl->gestureClient->isGestureWorking()) {
-        EditorState editorState = m_viewImpl->page()->editorState();
-        if (!editorState.selectionIsRange && editorState.isContentEditable)
-            setIsTextSelectionMode(false);
+    const EditorState& editorState = m_viewImpl->page()->editorState();
+    if (!editorState.selectionIsRange && editorState.isContentEditable) {
+        setIsTextSelectionMode(false);
+        return;
     }
 
     if (isShow) {
@@ -562,6 +561,16 @@ void TextSelection::updateHandlesAndContextMenu(bool isShow, bool isScrolling)
         if (m_showTimer)
             return;
 
+        InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
+        if (inputMethodContext) {
+            bool isIMEShow = inputMethodContext->isShow();
+            int isIMEState = inputMethodContext->state();
+            if (!isIMEShow && isIMEState == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW) {
+                requestToShow();
+                return;
+            }
+        }
+
         updateHandlers();
         showContextMenu();
     } else {
index 100aa93..24c0661 100755 (executable)
@@ -634,6 +634,7 @@ void InputMethodContextEfl::onFocusIn()
 
     ecore_imf_context_focus_in(m_context.get());
     ecore_imf_context_input_panel_show(m_context.get());
+    setState(ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW);
 }
 
 void InputMethodContextEfl::onFocusOut()
@@ -775,6 +776,7 @@ void InputMethodContextEfl::showIMFContext(const EditorState& editor, bool isUse
     resetIMFContext();
     ecore_imf_context_focus_in(m_context.get());
     ecore_imf_context_input_panel_show(m_context.get());
+    setState(ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW);
 }
 
 void InputMethodContextEfl::hideIMFContext()
index 95bd2f5..fecea96 100755 (executable)
@@ -69,6 +69,7 @@ public:
     void hideIMFContext();
     bool isIMEPostion(int, int);
     void removeIMFContext(uintptr_t);
+    int state() { return m_state; }
 #endif
 
 private: