int clipboardItemSize = ClipboardHelper::numberOfItems();
TIZEN_LOGI("clipboardItemSize : %d", clipboardItemSize);
#endif
- bool isContextMenuForTextSelection = false;
+
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ m_isContextMenuForTextSelection = false;
+#endif
+
for (size_t i = 0; i < size; i++) {
#if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
if ((m_items.at(i).action() == ContextMenuItemTagPaste || m_items.at(i).action() == ContextMenuItemTagClipboard) && !clipboardItemSize)
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
if (m_items.at(i).action() == ContextMenuItemTagCopy || m_items.at(i).action() == ContextMenuItemTagSelectAll
|| m_items.at(i).action() == ContextMenuItemTagSelectWord || m_items.at(i).action() == ContextMenuItemTagPaste)
- isContextMenuForTextSelection = true;
+ m_isContextMenuForTextSelection = true;
#endif
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_ICON_TYPE_SUPPORT)
contextMenuItemSelectedCallback, &(m_items.at(i)));
#endif
}
-
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
- if (isContextMenuForTextSelection) {
- if (!m_pageClientImpl->isTextSelectionMode())
- m_pageClientImpl->setIsTextSelectionMode(true);
- elm_object_style_set(m_popup,"copypaste");
- elm_ctxpopup_horizontal_set(m_popup, EINA_TRUE);
- elm_ctxpopup_direction_priority_set(m_popup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP);
- }
-#endif
}
static void contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo)
createEflMenu(items);
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (m_isContextMenuForTextSelection && !evas_object_focus_get(m_webView))
+ return;
+#endif
+
if (m_popup) {
int webViewX, webViewY;
evas_object_geometry_get(m_webView, &webViewX, &webViewY, 0, 0);
popupPosition.setX(popupPosition.x() + webViewX);
popupPosition.setY(popupPosition.y() + webViewY);
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (m_isContextMenuForTextSelection) {
+ if (!m_pageClientImpl->isTextSelectionMode())
+ m_pageClientImpl->setIsTextSelectionMode(true);
+ elm_object_style_set(m_popup,"copypaste");
+ elm_ctxpopup_horizontal_set(m_popup, EINA_TRUE);
+ elm_ctxpopup_direction_priority_set(m_popup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP);
+ }
+#endif
+
evas_object_move(m_popup, popupPosition.x(), popupPosition.y());
evas_object_show(m_popup);