From 3e7ca1dbd6ec3d0d07e3e667619424b89d6843be Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Wed, 16 Oct 2013 14:48:09 +0900 Subject: [PATCH] Add back-key exception during fullscreen by default video tag [Issue#] LINUXWRT-1035 [Problem] In case of fullscreen is enabled by default video tag, back-key works to exit fullscreen. However, "tizenhwkey" event also dispatch to application. [Cause] Missed to consider. [Solution] Move current implementation from wrt-client to view_logic for early return before dispatch "tizenhwkey" event. [Verification] Install test application attached LINUXWRT-1035. Launch application -> change video to fullscreen. Select back-key -> Application not terminate [SCMRequest] N/A Conflicts: src/view/webkit/view_logic.cpp src/wrt-client/wrt-client.cpp Change-Id: I4c8f510281216d95ca170db047f07aeb61b022ab --- src/api_new/user_delegates.h | 2 +- src/view/webkit/view_logic.cpp | 18 ++++++++++++++---- src/view/webkit/view_logic.h | 1 + src/wrt-client/wrt-client.cpp | 17 +---------------- src/wrt-client/wrt-client.h | 3 +-- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/api_new/user_delegates.h b/src/api_new/user_delegates.h index 4adbc12..13a95dd 100644 --- a/src/api_new/user_delegates.h +++ b/src/api_new/user_delegates.h @@ -44,7 +44,7 @@ typedef DPL::FastDelegate1 SuspendCB; typedef DPL::FastDelegate1 ResetCB; typedef DPL::FastDelegate1 BufferUnsetCB; typedef DPL::FastDelegate1 BufferSetCB; -typedef DPL::FastDelegate2 EnterFullscreenCB; +typedef DPL::FastDelegate1 EnterFullscreenCB; typedef DPL::FastDelegate1 ExitFullscreenCB; typedef DPL::FastDelegate1 EditorclientImeCB; typedef DPL::FastDelegate1 OrientationCB; diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 954177e..ee167ed 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -191,6 +191,7 @@ ViewLogic::ViewLogic() : ViewModule::OrientationSupport::DEFERRED_ORIENTATION_EMPTY), m_orientationThresholdTimer(NULL), m_isPopupReplyWait(false), + m_isFullscreenByPlatform(false), m_appsSupport(new ViewModule::AppsSupport()), m_vibrationSupport(new ViewModule::VibrationSupport()), m_webNotificationSupport(new ViewModule::WebNotificationSupport()) @@ -1447,13 +1448,12 @@ void ViewLogic::enterFullscreenCallback( This->m_ewkContext, "fullscreen"); - bool isFullscreenByPlatform = false; if (eventInfo) { - isFullscreenByPlatform = - (*static_cast(eventInfo) == EINA_TRUE); + This->m_isFullscreenByPlatform = + *static_cast(eventInfo) == EINA_TRUE; } if (!This->m_cbs->enterFullscreen.empty()) { - This->m_cbs->enterFullscreen(obj, isFullscreenByPlatform); + This->m_cbs->enterFullscreen(obj); } } @@ -1468,6 +1468,8 @@ void ViewLogic::exitFullscreenCallback( ViewLogicMessageSupport::setViewmodes( This->m_ewkContext, Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT); + + This->m_isFullscreenByPlatform = false; if (!This->m_cbs->exitFullscreen.empty()) { This->m_cbs->exitFullscreen(obj); } @@ -1967,6 +1969,14 @@ void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo) if (keyType == EA_CALLBACK_BACK) { Assert(obj); #if 0 // FIXME!!!! ewk_view_text_selection_clear has not landed yet + // Call fullscreen exit API + // In case of fullscreen is entered by platform(default video tag), + // automatically exit fullscreen when backkey is selected + if (This->m_isFullscreenByPlatform) { + ewk_view_fullscreen_exit(obj); + return; + } + // Call text selection clear API // In case of current state is selection mode, // application doesn't need to handle back key diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h index 06173b2..4fe5ec9 100644 --- a/src/view/webkit/view_logic.h +++ b/src/view/webkit/view_logic.h @@ -315,6 +315,7 @@ class ViewLogic : public ViewModule::IViewModule int m_deferredRotateAngle; Ecore_Timer* m_orientationThresholdTimer; bool m_isPopupReplyWait; + bool m_isFullscreenByPlatform; std::unique_ptr m_appsSupport; std::unique_ptr m_vibrationSupport; diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index e31c677..2f1ff46 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -83,7 +83,6 @@ WrtClient::WrtClient(int argc, char **argv) : m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED), m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED), m_isWebkitFullscreen(false), - m_isFullscreenByPlatform(false), m_submodeSupport(new ClientModule::SubmodeSupport()) { Touch(); @@ -344,16 +343,12 @@ void WrtClient::webCrashCallback() NextStepEvent()); } -void WrtClient::enterFullscreenCallback(Evas_Object* /*obj*/, - bool isFullscreenByPlatform) +void WrtClient::enterFullscreenCallback(Evas_Object* /*obj*/) { // enter fullscreen m_windowData->toggleFullscreen(true); m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN; m_isWebkitFullscreen = true; - if (isFullscreenByPlatform) { - m_isFullscreenByPlatform = true; - } } void WrtClient::exitFullscreenCallback(Evas_Object* /*obj*/) @@ -362,7 +357,6 @@ void WrtClient::exitFullscreenCallback(Evas_Object* /*obj*/) m_windowData->toggleFullscreen(false); m_currentViewMode = m_initialViewMode; m_isWebkitFullscreen = false; - m_isFullscreenByPlatform = false; } void WrtClient::launchStep() @@ -784,15 +778,6 @@ void WrtClient::hwkeyCallback(const std::string& key) // UX isn't confirmed // m_windowData->showCtxpopup(); } - } else { - // packaged application - if (key == KeyName::BACK) { - if (m_isFullscreenByPlatform) { - // FIXME!!! This method has not yet landed in the tizen 3.0 - // webkit-efl source tree - //ewk_view_fullscreen_exit(m_widget->GetCurrentWebview()); - } - } } } diff --git a/src/wrt-client/wrt-client.h b/src/wrt-client/wrt-client.h index 18702d6..3066457 100644 --- a/src/wrt-client/wrt-client.h +++ b/src/wrt-client/wrt-client.h @@ -127,7 +127,7 @@ class WrtClient : void progressFinishCallback(); void webkitExitCallback(); void webCrashCallback(); - void enterFullscreenCallback(Evas_Object* obj, bool isFullscreenByPlatform); + void enterFullscreenCallback(Evas_Object* obj); void exitFullscreenCallback(Evas_Object* obj); void setLayout(Evas_Object* newBuffer); void unsetLayout(Evas_Object* currentBuffer); @@ -149,7 +149,6 @@ class WrtClient : std::string m_initialViewMode; std::string m_currentViewMode; bool m_isWebkitFullscreen; - bool m_isFullscreenByPlatform; std::unique_ptr m_submodeSupport; }; -- 2.7.4