Fixed when IME disappear, copy & paste context menu is displayed twice.
authorTaeyun An <ty.an@samsung.com>
Wed, 16 Oct 2013 09:15:41 +0000 (18:15 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 21 Oct 2013 05:01:00 +0000 (05:01 +0000)
[Title] Fixed when IME disappear, copy & paste context menu is displayed twice.
[Issue#] P130830-03879
[Problem] When IME disappear, copy & paste context menu is displayed twice.
[Cause] When IME disappear, webview is resized.
        If parent of copy & paste context menu is resized, "dismissed" callback fucntion to hide copy & paste context menu  is called.
        And then, copy & paste context menu is updated by setVisibleContentRect() function.
        So, copy & paste context menu is displayed twice.
[Solution] 1. Prevent to hide copy & paste context menu automatically using elm_ctxpopup_auto_hide_disabled_set() function.
           2. If geometry, visibleContentRect or etc.. of webview are not chagned,
              copy & paste context menu is not update again.

Change-Id: I6c79d8722443b4676b231da36910664d5c96fde7

Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp
Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp

index c125a21..0aa15a3 100755 (executable)
@@ -968,8 +968,12 @@ void PageClientImpl::setVisibleContentRect(const IntRect& newRect, float newScal
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-    if (!isClipboardWindowOpened())
-        updateTextSelectionHandlesAndContextMenu(true);
+    if (!isClipboardWindowOpened()) {
+        if (m_viewImpl->scrollPosition() != previousScrollPosition || m_viewImpl->scaleFactor() != previousScale) {
+            updateTextSelectionHandlesAndContextMenu(false);
+            updateTextSelectionHandlesAndContextMenu(true);
+        }
+    }
 #endif
 }
 
index 6b9a294..9738ffa 100755 (executable)
@@ -853,6 +853,7 @@ void TextSelection::showHandlesAndContextMenu()
             ecore_timer_del(m_showTimer);
             m_showTimer = 0;
         }
+        updateHandlesAndContextMenu(false);
     }
 }
 
index 19752f0..3e30b18 100755 (executable)
@@ -266,6 +266,8 @@ void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position
     evas_object_show(m_popup);
 
     evas_object_smart_callback_add(m_popup, "dismissed", contextMenuPopupDismissedCallback, this);
+    //# FIXME: Below comment should be relesed when API applied by EFL side.
+    //elm_ctxpopup_auto_hide_disabled_set(m_popup, EINA_TRUE);
 #if ENABLE(TIZEN_HW_MORE_BACK_KEY)
     if (EflAssistHandle && !m_isContextMenuForTextSelection) {
         void (*webkit_ea_object_event_callback_add)(Evas_Object *, Ea_Callback_Type , Ea_Event_Cb func, void *);