From a7e6b9817d1f42f6bbac91c6f2e5ff39f38189e0 Mon Sep 17 00:00:00 2001 From: Taeyun An Date: Thu, 13 Jun 2013 21:55:38 +0900 Subject: [PATCH] Prevent to show context menu after unlocked [Title] Prevent to show context menu after unlocked [Issue#] N_SE-41092 [Problem] Sometimes context menu is appeared after unlocked [Cause] There is existed timing issue when try to device lock. It makes appear context menu after webview has focused out. [Solution] Prevent to show context menu after unlocked. Change-Id: I52bcd122ad1c739478b27a7d2f45a63a95b18af6 --- .../UIProcess/tizen/WebContextMenuProxyTizen.cpp | 33 ++++++++++++++-------- .../UIProcess/tizen/WebContextMenuProxyTizen.h | 4 +++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp index 790e513..98d1000 100755 --- a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp +++ b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp @@ -136,7 +136,11 @@ void WebContextMenuProxyTizen::createEflMenu(const VectorisTextSelectionMode()) - 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) @@ -217,6 +211,11 @@ void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position 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); @@ -231,6 +230,16 @@ void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position 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); diff --git a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h index 98586e0..cd7bdd5 100644 --- a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h +++ b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h @@ -71,6 +71,10 @@ private: #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE) WebCore::IntPoint m_positionForSelection; #endif + +#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) + bool m_isContextMenuForTextSelection; +#endif }; -- 2.7.4