From fc5cd3021777786b51fed198a44fd54124b2d5d4 Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Mon, 4 Jun 2018 14:49:15 +0530 Subject: [PATCH 01/16] Runtime object creation code cleanup. Change-Id: I6abd9fa5e506099def2ca41143887dbb9f7edccc Signed-off-by: k2.nagaraju --- runtime/browser/runtime.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/runtime/browser/runtime.cc b/runtime/browser/runtime.cc index 8e68210..01af3bf 100644 --- a/runtime/browser/runtime.cc +++ b/runtime/browser/runtime.cc @@ -41,24 +41,19 @@ Runtime::~Runtime() { std::unique_ptr Runtime::MakeRuntime( common::ApplicationData* app_data) { - if (app_data->app_type() == common::ApplicationData::UI) { - return std::unique_ptr(new UiRuntime(app_data)); - } #ifdef IME_FEATURE_SUPPORT - else if (TIZEN_FEATURE_web_ime_support && - app_data->app_type() == common::ApplicationData::IME) { + if (TIZEN_FEATURE_web_ime_support && + app_data->app_type() == common::ApplicationData::IME) { return std::unique_ptr(new ImeRuntime(app_data)); } #endif // IME_FEATURE_SUPPORT #ifdef WATCH_FACE_FEATURE_SUPPORT - else if (TIZEN_FEATURE_watch_face_support && - app_data->app_type() == common::ApplicationData::WATCH) { + if (TIZEN_FEATURE_watch_face_support && + app_data->app_type() == common::ApplicationData::WATCH) { return std::unique_ptr(new WatchRuntime(app_data)); } #endif // WATCH_FACE_FEATURE_SUPPORT - else { - return std::unique_ptr(new UiRuntime(app_data)); - } + return std::unique_ptr(new UiRuntime(app_data)); } void Runtime::ProcessClosingPage(WebApplication* application) { -- 2.7.4 From 0ac321d81ee989f42adf03ebed1ada53a73fe960 Mon Sep 17 00:00:00 2001 From: Prathmesh Date: Fri, 22 Jun 2018 10:00:03 +0530 Subject: [PATCH 02/16] Show window on frame rendered after appcontrol reset - Currently window is shown after reset once appcontrol is received. Due to this sometimes old contents are visible first then new contents are rendered - If the app is reset on app-control then do show the window right away. Rather the window will be shown once frame rendered is received Change-Id: Ice201a6c6ff35430186abcad917af767fb1ccdaf Signed-off-by: Prathmesh --- runtime/browser/web_application.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 9039ca7..e9c9c33 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -626,7 +626,11 @@ void WebApplication::AppControl( if (!verbose_mode_ && appcontrol->data(kVerboseKey) == "true") { verbose_mode_ = true; } - window_->Active(); + + // If app was reset then show window after new frame + // is rendered. Else old page will be displayed + if (!do_reset) + window_->Active(); } void WebApplication::SendAppControlEvent() { -- 2.7.4 From 3a8f307a04aefd6c7c2049aea130a0004c8a6e0a Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Fri, 22 Jun 2018 06:21:44 +0000 Subject: [PATCH 03/16] Revert "Show window on frame rendered after appcontrol reset" This reverts commit 0ac321d81ee989f42adf03ebed1ada53a73fe960. Change-Id: Icc64ab6ef123581210cbc552eff33a645727b670 --- runtime/browser/web_application.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index e9c9c33..9039ca7 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -626,11 +626,7 @@ void WebApplication::AppControl( if (!verbose_mode_ && appcontrol->data(kVerboseKey) == "true") { verbose_mode_ = true; } - - // If app was reset then show window after new frame - // is rendered. Else old page will be displayed - if (!do_reset) - window_->Active(); + window_->Active(); } void WebApplication::SendAppControlEvent() { -- 2.7.4 From a65c5d3b06f018bb826d6c4e0d508f2c8a2aaab8 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Fri, 6 Jul 2018 09:23:00 +0900 Subject: [PATCH 04/16] Changed EFL_UTIL_NOTIFICATION_LEVEL_3 to EFL_UTIL_NOTIFICATION_LEVEL_TOP Change-Id: I052067a177e95513ddc09e52fac5368611755126 Signed-off-by: jaekuk, lee --- runtime/browser/notification_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 runtime/browser/notification_window.cc diff --git a/runtime/browser/notification_window.cc b/runtime/browser/notification_window.cc old mode 100644 new mode 100755 index e701601..3ff7f3e --- a/runtime/browser/notification_window.cc +++ b/runtime/browser/notification_window.cc @@ -28,7 +28,7 @@ Evas_Object* NotificationWindow::CreateWindowInternal() { elm_config_accel_preference_set("opengl"); Evas_Object* window = elm_win_add(NULL, "xwalk-window", ELM_WIN_NOTIFICATION); efl_util_set_notification_window_level(window, - EFL_UTIL_NOTIFICATION_LEVEL_3); + EFL_UTIL_NOTIFICATION_LEVEL_TOP); SetAlwaysOnTop(window, true); return window; } -- 2.7.4 From d4211b0eeb7d2a5e03dbd2982f2be35b0ac3d030 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Fri, 6 Jul 2018 09:23:00 +0900 Subject: [PATCH 05/16] Change EFL_UTIL_NOTIFICATION_LEVEL_3 to EFL_UTIL_NOTIFICATION_LEVEL_TOP http://mosaic.sec.samsung.net/kms/comty.do?comtyId=2305148&menuId=2305189&postId=43363033&page=view&type=LIST Change-Id: I052067a177e95513ddc09e52fac5368611755126 Signed-off-by: jaekuk, lee --- runtime/browser/notification_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 runtime/browser/notification_window.cc diff --git a/runtime/browser/notification_window.cc b/runtime/browser/notification_window.cc old mode 100644 new mode 100755 index e701601..3ff7f3e --- a/runtime/browser/notification_window.cc +++ b/runtime/browser/notification_window.cc @@ -28,7 +28,7 @@ Evas_Object* NotificationWindow::CreateWindowInternal() { elm_config_accel_preference_set("opengl"); Evas_Object* window = elm_win_add(NULL, "xwalk-window", ELM_WIN_NOTIFICATION); efl_util_set_notification_window_level(window, - EFL_UTIL_NOTIFICATION_LEVEL_3); + EFL_UTIL_NOTIFICATION_LEVEL_TOP); SetAlwaysOnTop(window, true); return window; } -- 2.7.4 From 99b64b8ae3f78a5a48b9c30d0da3a2d590f25f5b Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 4 Sep 2018 19:23:17 +0900 Subject: [PATCH 06/16] Fixed crash issue occurred when terminating App using HOME Key Change-Id: Iecdadb9e2baf5c41b8389576dc7103ac63534b9a Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 26 +++++++++++++++----------- runtime/browser/web_application.h | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 9039ca7..2b8eb4a 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -775,7 +775,7 @@ void WebApplication::OnCreatedNewWebView(WebView* /*view*/, WebView* new_view) { vc_webview_->vc_webview_set_view(new_view->evas_object()); } -void WebApplication::RemoveWebViewFromStack(WebView* view) { +void WebApplication::RemoveWebViewFromStack(WebView* view, bool is_closed_webview_called) { if (view_stack_.size() == 0) return; @@ -815,13 +815,17 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { vc_webview_->vc_webview_set_view(view_stack_.front()->evas_object()); } - // Delete after the callback context(for ewk view) was not used - ecore_idler_add([](void* view) { - WebView* obj = static_cast(view); - delete obj; - return EINA_FALSE; - }, - view); + if (is_closed_webview_called) + delete view; + else { + // Delete after the callback context(for ewk view) was not used + ecore_idler_add([](void* view) { + WebView* obj = static_cast(view); + delete obj; + return EINA_FALSE; + }, + view); + } } Eina_Bool WebApplication::CheckPluginSession(void* user_data) @@ -842,7 +846,7 @@ Eina_Bool WebApplication::CheckPluginSession(void* user_data) void WebApplication::OnClosedWebView(WebView* view) { // Reply to javascript dialog for preventing freeze issue. view->ReplyToJavascriptDialog(); - RemoveWebViewFromStack(view); + RemoveWebViewFromStack(view, true); #if defined(TIZEN_PRODUCT_TV) LOGGER(DEBUG) << "plugin_session_count : " << @@ -1011,7 +1015,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { LOGGER(DEBUG) << "Terminate"; Terminate(); } else { - RemoveWebViewFromStack(view_stack_.front()); + RemoveWebViewFromStack(view_stack_.front(), false); } } } @@ -1031,7 +1035,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { LOGGER(DEBUG) << "Terminate"; Terminate(); } else { - RemoveWebViewFromStack(view_stack_.front()); + RemoveWebViewFromStack(view_stack_.front(), false); } } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index a724a09..af4fce2 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -125,7 +125,7 @@ class WebApplication : public WebView::EventListener { void LaunchInspector(common::AppControl* appcontrol); void SetupWebView(WebView* view); void SetupWebViewCompatibilitySettings(WebView* view); - void RemoveWebViewFromStack(WebView* view); + void RemoveWebViewFromStack(WebView* view, bool is_closed_webview_called); void SetupTizenVersion(); bool tizenWebKitCompatibilityEnabled() const; -- 2.7.4 From 694c67133f73409973a008246b44ed035a490ff1 Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Mon, 17 Sep 2018 06:33:41 +0000 Subject: [PATCH 07/16] Revert "Fixed crash issue occurred when terminating App using HOME Key" This reverts commit 99b64b8ae3f78a5a48b9c30d0da3a2d590f25f5b. Change-Id: I5f2a7d21035cf966353e80d5ab13c1afd1e5dca9 --- runtime/browser/web_application.cc | 26 +++++++++++--------------- runtime/browser/web_application.h | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 2b8eb4a..9039ca7 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -775,7 +775,7 @@ void WebApplication::OnCreatedNewWebView(WebView* /*view*/, WebView* new_view) { vc_webview_->vc_webview_set_view(new_view->evas_object()); } -void WebApplication::RemoveWebViewFromStack(WebView* view, bool is_closed_webview_called) { +void WebApplication::RemoveWebViewFromStack(WebView* view) { if (view_stack_.size() == 0) return; @@ -815,17 +815,13 @@ void WebApplication::RemoveWebViewFromStack(WebView* view, bool is_closed_webvie vc_webview_->vc_webview_set_view(view_stack_.front()->evas_object()); } - if (is_closed_webview_called) - delete view; - else { - // Delete after the callback context(for ewk view) was not used - ecore_idler_add([](void* view) { - WebView* obj = static_cast(view); - delete obj; - return EINA_FALSE; - }, - view); - } + // Delete after the callback context(for ewk view) was not used + ecore_idler_add([](void* view) { + WebView* obj = static_cast(view); + delete obj; + return EINA_FALSE; + }, + view); } Eina_Bool WebApplication::CheckPluginSession(void* user_data) @@ -846,7 +842,7 @@ Eina_Bool WebApplication::CheckPluginSession(void* user_data) void WebApplication::OnClosedWebView(WebView* view) { // Reply to javascript dialog for preventing freeze issue. view->ReplyToJavascriptDialog(); - RemoveWebViewFromStack(view, true); + RemoveWebViewFromStack(view); #if defined(TIZEN_PRODUCT_TV) LOGGER(DEBUG) << "plugin_session_count : " << @@ -1015,7 +1011,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { LOGGER(DEBUG) << "Terminate"; Terminate(); } else { - RemoveWebViewFromStack(view_stack_.front(), false); + RemoveWebViewFromStack(view_stack_.front()); } } } @@ -1035,7 +1031,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { LOGGER(DEBUG) << "Terminate"; Terminate(); } else { - RemoveWebViewFromStack(view_stack_.front(), false); + RemoveWebViewFromStack(view_stack_.front()); } } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index af4fce2..a724a09 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -125,7 +125,7 @@ class WebApplication : public WebView::EventListener { void LaunchInspector(common::AppControl* appcontrol); void SetupWebView(WebView* view); void SetupWebViewCompatibilitySettings(WebView* view); - void RemoveWebViewFromStack(WebView* view, bool is_closed_webview_called); + void RemoveWebViewFromStack(WebView* view); void SetupTizenVersion(); bool tizenWebKitCompatibilityEnabled() const; -- 2.7.4 From f9350cd970c80b677ebfe3b7dbb9990fd198a042 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Mon, 17 Sep 2018 15:45:55 +0900 Subject: [PATCH 08/16] Fixed crash issue occurred when terminating App using HOME Key To resolve the issue that ecore_idler_add() isn't called, Add ecore timer checking plugin_session_count. Change-Id: I6e95f205eb79bf3eac8472e5d77af44788d0ed09 Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 9039ca7..c74d4be 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -801,12 +801,6 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { auto extension_server = XWalkExtensionServer::GetInstance(); LOGGER(DEBUG) << "Shutdown extension server"; extension_server->Shutdown(); -#if !defined(TIZEN_PRODUCT_TV) - // Hide the window object for preventing the white screen - // during termination of web application. - evas_object_hide(window_->evas_object()); - Exit(); -#endif } else if (current != view_stack_.front()) { view_stack_.front()->SetVisibility(true); window_->SetContent(view_stack_.front()->evas_object()); @@ -844,7 +838,6 @@ void WebApplication::OnClosedWebView(WebView* view) { view->ReplyToJavascriptDialog(); RemoveWebViewFromStack(view); -#if defined(TIZEN_PRODUCT_TV) LOGGER(DEBUG) << "plugin_session_count : " << XWalkExtensionRendererController::plugin_session_count; @@ -857,7 +850,6 @@ void WebApplication::OnClosedWebView(WebView* view) { CheckPluginSession, &session_counter); if (!session_counter.timer) LOGGER(ERROR) << "It's failed to create session_counter timer"; -#endif } void WebApplication::OnReceivedWrtMessage(WebView* view, -- 2.7.4 From dc27f53837151ae4081f3568c2e7c0e0e8af5d4d Mon Sep 17 00:00:00 2001 From: Guneet K Date: Thu, 1 Feb 2018 19:08:51 +0530 Subject: [PATCH 09/16] [compatibility] Implemented window resize for non circular apps Apps with 320x320 and square apps are not displayed properly. View is truncated. Resize the view to 320x320 so that maximum possible view is displayed in visible area. These kind of apps are identified by profile tag. --------------------------------------------- | SlNo| Profile | Value | Display | --------------------------------------------- | 1 | Not Present | NA | 320x320 | | 2 | Present | mobile | 320x320 | | 3 | Present | NULL | 320x320 | | 4 | Present | wearable | 360x360 | --------------------------------------------- [Reference] http://slp-info.sec.samsung.net/gerrit/#/c/3119525/ Change-Id: Id39ce8f39c939de083e1ae2a7bc9efcaae8ca39a Signed-off-by: Guneet K Signed-off-by: deepti --- common/application_data.cc | 10 ++++++++++ common/application_data.h | 7 +++++++ common/platform_info.h | 2 ++ runtime/browser/native_window.cc | 13 +++++++++++-- runtime/browser/native_window.h | 7 +++++++ runtime/browser/preload_manager.cc | 4 +++- runtime/browser/ui_runtime.cc | 24 +++++++++++++++++++---- runtime/browser/watch_runtime.cc | 18 +++++++++++++++-- runtime/browser/web_application.cc | 12 ++++++++++++ runtime/browser/web_application.h | 1 + runtime/resources/xwalk_tizen.edc | 40 +++++++++++++++++++++++++++++++++----- runtime/runtime.gyp | 3 ++- 12 files changed, 126 insertions(+), 15 deletions(-) diff --git a/common/application_data.cc b/common/application_data.cc index a205ecc..cbcd2ad 100755 --- a/common/application_data.cc +++ b/common/application_data.cc @@ -122,6 +122,11 @@ std::shared_ptr return csp_report_info_; } +std::shared_ptr + ApplicationData::profile_tag_info() const { + return profile_tag_info_; +} + const std::string ApplicationData::pkg_id() const { if (pkg_id_.empty()) { app_info_h app_info; @@ -244,6 +249,11 @@ bool ApplicationData::LoadManifestData() { widget_config_parser->GetManifestData( wgt::parse::CSPInfo::Report_only_key())); + profile_tag_info_ = + std::static_pointer_cast( + widget_config_parser->GetManifestData( + wgt::parse::ProfileTagInfo::Key())); + // Set default empty object if (widget_info_.get() == NULL) { widget_info_.reset(new wgt::parse::WidgetInfo); diff --git a/common/application_data.h b/common/application_data.h index aa910e2..4419123 100755 --- a/common/application_data.h +++ b/common/application_data.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ class ApplicationData { csp_info() const; std::shared_ptr csp_report_info() const; + std::shared_ptr + profile_tag_info() const; const std::string application_path() const { return application_path_; } const std::string pkg_id() const; @@ -111,6 +114,10 @@ class ApplicationData { csp_info_; std::shared_ptr csp_report_info_; + + std::shared_ptr + profile_tag_info_; + ApplicationData::AppType GetAppType(); std::string application_path_; diff --git a/common/platform_info.h b/common/platform_info.h index 009c6f7..20732f7 100644 --- a/common/platform_info.h +++ b/common/platform_info.h @@ -38,6 +38,8 @@ enum _profile { (common::getProfile() & ((common::kPROFILE_WEARABLE))) #define TIZEN_FEATURE_rotary_event_support \ (common::getProfile() & ((common::kPROFILE_WEARABLE))) +#define TIZEN_FEATURE_display_resize_support \ + (common::getProfile() & ((common::kPROFILE_WEARABLE))) extern enum _profile getProfile(void); diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 5bbbc4d..7ca946e 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -80,9 +80,11 @@ NativeWindow::NativeWindow() top_layout_(NULL), rotation_(0), handler_id_(0), - natural_orientation_(ScreenOrientation::LANDSCAPE_PRIMARY) { + natural_orientation_(ScreenOrientation::PORTRAIT_PRIMARY), + display_shape_type_(Shape::STANDARD){ } + NativeWindow::~NativeWindow() { if (window_) evas_object_del(window_); @@ -126,7 +128,14 @@ void NativeWindow::Initialize() { // top layout Evas_Object* top_layout = elm_layout_add(conformant); - elm_layout_file_set(top_layout, kEdjePath, "web-application"); + if (display_shape_type_ == Shape::SQUARE) { + LOGGER(DEBUG) << "Device shape square"; + elm_layout_file_set(top_layout, kEdjePath, "web-applicationsview"); + } else { + LOGGER(DEBUG) << "Device shape standard"; + elm_layout_file_set(top_layout, kEdjePath, "web-application"); + } + EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index 3cd094d..981f2d5 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -38,6 +38,10 @@ class NativeWindow { NORMAL = 0, NOTIFICATION = 1 }; + enum class Shape { + STANDARD = 0, + SQUARE = 1 + }; typedef std::function RotationHandler; NativeWindow(); virtual ~NativeWindow(); @@ -65,6 +69,8 @@ class NativeWindow { Type type() const { return window_type_;} void EnableManualRotation(bool enable); void ManualRotationDone(); + void SetDisplayShape(Shape disp_shape) { display_shape_type_ = disp_shape; } + Shape GetDisplayShape() { return display_shape_type_; } void SignalEmit(const char* emission, const char* source); void UpdateProgress(double value); @@ -89,6 +95,7 @@ class NativeWindow { int rotation_; int handler_id_; ScreenOrientation natural_orientation_; + Shape display_shape_type_; std::map handler_table_; }; diff --git a/runtime/browser/preload_manager.cc b/runtime/browser/preload_manager.cc index fe1cce7..a8c482a 100755 --- a/runtime/browser/preload_manager.cc +++ b/runtime/browser/preload_manager.cc @@ -21,6 +21,7 @@ #include #include +#include "common/platform_info.h" #include "common/logger.h" #include "runtime/browser/native_app_window.h" #include "extensions/common/xwalk_extension_server.h" @@ -49,7 +50,8 @@ void PreloadManager::CreateCacheComponet() { ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH); context = context; // To prevent build warning cached_window_.reset(new NativeAppWindow()); - //cached_window_->Initialize(); + if (!TIZEN_FEATURE_display_resize_support) + cached_window_->Initialize(); } NativeWindow* PreloadManager::GetCachedNativeWindow() { diff --git a/runtime/browser/ui_runtime.cc b/runtime/browser/ui_runtime.cc index bb0e11a..45a465a 100755 --- a/runtime/browser/ui_runtime.cc +++ b/runtime/browser/ui_runtime.cc @@ -27,6 +27,7 @@ #include "common/app_db.h" #include "common/command_line.h" #include "common/logger.h" +#include "common/platform_info.h" #include "common/profiler.h" #include "runtime/common/constants.h" #include "runtime/browser/native_app_window.h" @@ -40,9 +41,9 @@ namespace { const char kCategoryAlwaysOnTop[] = "http://tizen.org/category/always_on_top"; -static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType) { +static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType, + NativeWindow::Shape win_shape) { SCOPE_PROFILE(); - NativeWindow* window; switch (windowType) { @@ -58,6 +59,7 @@ static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType) { } break; } + window->SetDisplayShape(win_shape); window->Initialize(); return window; @@ -76,6 +78,19 @@ bool AlwaysTopRequested(common::AppControl* appcontrol) { return appcontrol->data("always_on_top") == "true"; } +const char kConfigProfile[] = "mobile"; +NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) { + // As profile tag is not present app will be treated as square app + if (!app_data->profile_tag_info()) { + return NativeWindow::Shape::SQUARE; + } + std::string type = app_data->profile_tag_info()->GetProfileType(); + if (!type.compare(kConfigProfile)) { + return NativeWindow::Shape::SQUARE; + } + return NativeWindow::Shape::STANDARD; +} + } // namespace UiRuntime::UiRuntime(common::ApplicationData* app_data) @@ -100,8 +115,9 @@ void UiRuntime::ResetWebApplication(NativeWindow::Type windowType) { application_.reset(); native_window_.reset(); - - native_window_.reset(CreateNativeWindow(windowType)); + if (TIZEN_FEATURE_display_resize_support) + native_window_.reset(CreateNativeWindow(windowType, GetWindowType(app_data_))); + else native_window_.reset(CreateNativeWindow(windowType, NativeWindow::Shape::STANDARD)); LOGGER(DEBUG) << "runtime.cc Created native window"; application_.reset(new WebApplication(native_window_.get(), app_data_, diff --git a/runtime/browser/watch_runtime.cc b/runtime/browser/watch_runtime.cc index 39302ca..749e4f9 100755 --- a/runtime/browser/watch_runtime.cc +++ b/runtime/browser/watch_runtime.cc @@ -35,7 +35,7 @@ namespace runtime { namespace { -static NativeWindow* CreateNativeWindow() { +static NativeWindow* CreateNativeWindow(NativeWindow::Shape win_shape) { SCOPE_PROFILE(); NativeWindow* window = NULL; auto cached = PreloadManager::GetInstance()->GetCachedNativeWindow(); @@ -43,11 +43,25 @@ static NativeWindow* CreateNativeWindow() { delete cached; } window = new NativeWatchWindow(); + window->SetDisplayShape(win_shape); window->Initialize(); return window; } +const char kConfigProfile[] = "mobile"; +NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) { + // As profile tag is not present app will be treated as square app + if (!app_data->profile_tag_info()) { + return NativeWindow::Shape::SQUARE; + } + std::string type = app_data->profile_tag_info()->GetProfileType(); + if (!type.compare(kConfigProfile)) { + return NativeWindow::Shape::SQUARE; + } + return NativeWindow::Shape::STANDARD; +} + } // namespace WatchRuntime::WatchRuntime(common::ApplicationData* app_data) @@ -85,7 +99,7 @@ bool WatchRuntime::OnCreate() { appdb->Remove(kAppDBRuntimeSection, kAppDBRuntimeBundle); // Init WebApplication - native_window_ = CreateNativeWindow(); + native_window_ = CreateNativeWindow(GetWindowType(app_data_)); STEP_PROFILE_START("WebApplication Create"); application_ = new WebApplication(native_window_, app_data_); STEP_PROFILE_END("WebApplication Create"); diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index c74d4be..c5f0c0a 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -515,6 +515,8 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { WebView* view = new WebView(window_, ewk_context_); SetupWebView(view); SetupWebViewCompatibilitySettings(view); + if (TIZEN_FEATURE_display_resize_support) + SetDisplayEffect(view); std::unique_ptr res = resource_manager_->GetStartResource(appcontrol.get()); @@ -1273,6 +1275,16 @@ void WebApplication::SetupWebViewCompatibilitySettings(WebView* view) { } } +void WebApplication::SetDisplayEffect(WebView* view) { + if (window_->GetDisplayShape() == NativeWindow::Shape::SQUARE) { + // Currently blur effect API is called on view, which is not + // correct. Needs to be moved to context. Once new API is + // provided on context below code will get changed. + LOGGER(DEBUG) << "WebApplication::Set Blur effect"; + ewk_view_mirrored_blur_set(view->evas_object(), true); + } +} + bool WebApplication::OnDidNavigation(WebView* /*view*/, const std::string& url) { // scheme handling diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index a724a09..5b247b2 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -125,6 +125,7 @@ class WebApplication : public WebView::EventListener { void LaunchInspector(common::AppControl* appcontrol); void SetupWebView(WebView* view); void SetupWebViewCompatibilitySettings(WebView* view); + void SetDisplayEffect(WebView* view); void RemoveWebViewFromStack(WebView* view); void SetupTizenVersion(); diff --git a/runtime/resources/xwalk_tizen.edc b/runtime/resources/xwalk_tizen.edc index a48c190..c612e64 100755 --- a/runtime/resources/xwalk_tizen.edc +++ b/runtime/resources/xwalk_tizen.edc @@ -25,11 +25,6 @@ collections { type: SWALLOW; description { state: "default" 0.0; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: base; } - rel2 { relative: 1.0 1.0; to: base; } - align: 0.0 0.0; - } /* ratio 1x1 (only for gear3) */ description { @@ -95,6 +90,41 @@ collections { }//end of group group { + name: "web-applicationsview"; + inherit: "web-application"; + parts{ + part { + name: "elm.swallow.content"; + scale: 0; + type: SWALLOW; + description { + state: "default" 0.0; + //rel1 { offset: 20 20; } + //rel2 { offset: -20 -20; } + min: 320 320; + max: 320 320; + fixed: 1 1; + } + // Below code will also do the same + /*description { + state: "default" 0.0; + rel1 { offset: 20 20; } + rel2 { offset: -20 -20; } + }*/ + + /* ratio 1x1 (only for gear3) */ + description { + state: "ratio1x1" 0.0; + fixed: 1 1; + aspect: 1 1; + aspect_preference: BOTH; + align: 0.5 0.5; + } + } + } + } + + group { name: "PopupTextEntrySet"; parts{ part { diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index 5772a35..e56deee 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -70,7 +70,8 @@ 'defines': ['TIZEN_PRODUCT_TV'], }], ['tizen_model_formfactor == "circle"', { - 'defines': ['MODEL_FORMFACTOR_CIRCLE'], + 'defines': ['MODEL_FORMFACTOR_CIRCLE', + 'DISPLAY_RESIZE_SUPPORT'], }], ['tizen_feature_rotary_event_support == 1', { 'defines': ['ROTARY_EVENT_FEATURE_SUPPORT'], -- 2.7.4 From 2420a5dcf10f068ae639807a19b0e096282afa23 Mon Sep 17 00:00:00 2001 From: guneet khosla Date: Fri, 28 Sep 2018 16:40:52 +0530 Subject: [PATCH 10/16] Disable cached_window_->Initialize() Disable cached_window_->Initialize() for all profiles. Earlier Initialized was being called for TV and TM1 profiles. Change-Id: Idf3be7d046c7925dfaa5057360da8aa2b8a9650c Signed-off-by: guneet khosla --- runtime/browser/preload_manager.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/browser/preload_manager.cc b/runtime/browser/preload_manager.cc index a8c482a..fe1cce7 100755 --- a/runtime/browser/preload_manager.cc +++ b/runtime/browser/preload_manager.cc @@ -21,7 +21,6 @@ #include #include -#include "common/platform_info.h" #include "common/logger.h" #include "runtime/browser/native_app_window.h" #include "extensions/common/xwalk_extension_server.h" @@ -50,8 +49,7 @@ void PreloadManager::CreateCacheComponet() { ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH); context = context; // To prevent build warning cached_window_.reset(new NativeAppWindow()); - if (!TIZEN_FEATURE_display_resize_support) - cached_window_->Initialize(); + //cached_window_->Initialize(); } NativeWindow* PreloadManager::GetCachedNativeWindow() { -- 2.7.4 From 98e98c8ef339ca374898453e5ad944fcdd05d3bd Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Wed, 19 Sep 2018 12:22:27 +0530 Subject: [PATCH 11/16] Getting new-delete-type-mismatch from ASAN. Polymorphic base classes should declare virtual destructors. If a class has any virtual functions, it should have a virtual destructor. Change-Id: I130a777f65f3e3c50afcac2dbe822a5ea3645b6a Signed-off-by: k2.nagaraju --- runtime/browser/web_view.h | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/browser/web_view.h b/runtime/browser/web_view.h index 82bbe84..96ea878 100755 --- a/runtime/browser/web_view.h +++ b/runtime/browser/web_view.h @@ -107,6 +107,7 @@ class WebView { WebView* /*view*/, RotaryEventType /*type*/) {} virtual void OnRotatePrepared(WebView* /*view*/) {} + virtual ~EventListener() {} }; WebView(NativeWindow* window, Ewk_Context* context); -- 2.7.4 From a5901d45b8b715ddb3315b46b057c7c87675c66e Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Fri, 28 Sep 2018 21:44:00 +0530 Subject: [PATCH 12/16] get widget.width and widget.height from widget_info widget.width and widget.height values should be get from widget_info object not from window.innerWidth and window.innerHeight. Change-Id: I7c1974653b0166ea331177bc3d545025877365c6 Signed-off-by: k2.nagaraju --- extensions/internal/widget/widget_api.js | 12 ++++-------- extensions/renderer/widget_module.cc | 6 ++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/extensions/internal/widget/widget_api.js b/extensions/internal/widget/widget_api.js index 6a5b7a6..fe680f1 100755 --- a/extensions/internal/widget/widget_api.js +++ b/extensions/internal/widget/widget_api.js @@ -67,16 +67,12 @@ function Widget() { writable: false }, "height": { - get: function() { - return window && window.innerHeight || 0; - }, - configurable: false + value: widget_info_["height"], + writable: false }, "width": { - get: function() { - return window && window.innerWidth || 0; - }, - configurable: false + value: widget_info_["width"], + writable: false }, "preferences": { value: preference_, diff --git a/extensions/renderer/widget_module.cc b/extensions/renderer/widget_module.cc index 2237501..4f5b803 100644 --- a/extensions/renderer/widget_module.cc +++ b/extensions/renderer/widget_module.cc @@ -348,6 +348,12 @@ v8::Handle WidgetModule::NewInstance() { widget->Set( v8::String::NewFromUtf8(isolate, "authorHref"), v8::String::NewFromUtf8(isolate, widgetdb->authorHref().c_str())); + widget->Set( + v8::String::NewFromUtf8(isolate, "width"), + v8::Uint32::NewFromUnsigned(isolate, widgetdb->width())); + widget->Set( + v8::String::NewFromUtf8(isolate, "height"), + v8::Uint32::NewFromUnsigned(isolate, widgetdb->height())); return handle_scope.Escape(widget); } -- 2.7.4 From 1c24c3fe301b7fab4841c8181a9bbee3c9067d15 Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Mon, 1 Oct 2018 10:12:23 +0530 Subject: [PATCH 13/16] Revert "Disable cached_window_->Initialize()" This reverts commit 2420a5dcf10f068ae639807a19b0e096282afa23. Change-Id: I16ba4520beb640b76ff88640c307eb14752616f2 Signed-off-by: k2.nagaraju --- runtime/browser/preload_manager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/browser/preload_manager.cc b/runtime/browser/preload_manager.cc index fe1cce7..a8c482a 100755 --- a/runtime/browser/preload_manager.cc +++ b/runtime/browser/preload_manager.cc @@ -21,6 +21,7 @@ #include #include +#include "common/platform_info.h" #include "common/logger.h" #include "runtime/browser/native_app_window.h" #include "extensions/common/xwalk_extension_server.h" @@ -49,7 +50,8 @@ void PreloadManager::CreateCacheComponet() { ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH); context = context; // To prevent build warning cached_window_.reset(new NativeAppWindow()); - //cached_window_->Initialize(); + if (!TIZEN_FEATURE_display_resize_support) + cached_window_->Initialize(); } NativeWindow* PreloadManager::GetCachedNativeWindow() { -- 2.7.4 From 18e8b124a7cb060cbede297e7bdeb9e500920baa Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Wed, 3 Oct 2018 11:08:21 +0530 Subject: [PATCH 14/16] Revert "get widget.width and widget.height from widget_info" This reverts commit a5901d45b8b715ddb3315b46b057c7c87675c66e. Change-Id: I788f7d1364c590d7bbfc04adcc7b6c7350627344 Signed-off-by: k2.nagaraju --- extensions/internal/widget/widget_api.js | 12 ++++++++---- extensions/renderer/widget_module.cc | 6 ------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/extensions/internal/widget/widget_api.js b/extensions/internal/widget/widget_api.js index fe680f1..6a5b7a6 100755 --- a/extensions/internal/widget/widget_api.js +++ b/extensions/internal/widget/widget_api.js @@ -67,12 +67,16 @@ function Widget() { writable: false }, "height": { - value: widget_info_["height"], - writable: false + get: function() { + return window && window.innerHeight || 0; + }, + configurable: false }, "width": { - value: widget_info_["width"], - writable: false + get: function() { + return window && window.innerWidth || 0; + }, + configurable: false }, "preferences": { value: preference_, diff --git a/extensions/renderer/widget_module.cc b/extensions/renderer/widget_module.cc index 4f5b803..2237501 100644 --- a/extensions/renderer/widget_module.cc +++ b/extensions/renderer/widget_module.cc @@ -348,12 +348,6 @@ v8::Handle WidgetModule::NewInstance() { widget->Set( v8::String::NewFromUtf8(isolate, "authorHref"), v8::String::NewFromUtf8(isolate, widgetdb->authorHref().c_str())); - widget->Set( - v8::String::NewFromUtf8(isolate, "width"), - v8::Uint32::NewFromUnsigned(isolate, widgetdb->width())); - widget->Set( - v8::String::NewFromUtf8(isolate, "height"), - v8::Uint32::NewFromUnsigned(isolate, widgetdb->height())); return handle_scope.Escape(widget); } -- 2.7.4 From 181354aeeea14a1538457ccfc6d166d6b751124e Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Wed, 3 Oct 2018 16:02:17 +0530 Subject: [PATCH 15/16] [HOTFIX] Force resize the webview height and width to window height and width. Change-Id: I55e2dd9f4894017e704a18f80405cc55ba6a492d Signed-off-by: k2.nagaraju --- runtime/browser/native_window.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 7ca946e..a6e332d 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -241,8 +241,11 @@ void NativeWindow::SetContent(Evas_Object* content) { elm_object_focus_set(focus_, EINA_TRUE); content_ = content; - // attached webview was resized by evas_norender API - evas_norender(evas_object_evas_get(window_)); + // Force resize to window width and height + int w, h; + elm_win_screen_size_get(window_, NULL, NULL, &w, &h); + LOGGER(DEBUG)<< "w " << w << " h " << h; + evas_object_resize(content, w, h); } void NativeWindow::DidRotation(int degree) { -- 2.7.4 From 2c73b4736c57de6698942cd6ae87ac80170f59ac Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Thu, 4 Oct 2018 08:25:44 +0000 Subject: [PATCH 16/16] Revert "Fixed crash issue occurred when terminating App using HOME Key" This reverts commit f9350cd970c80b677ebfe3b7dbb9990fd198a042. Change-Id: I39e10f69118498b9fc7be5d910a02525e440a9c6 --- runtime/browser/web_application.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index c5f0c0a..43be4fb 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -803,6 +803,12 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { auto extension_server = XWalkExtensionServer::GetInstance(); LOGGER(DEBUG) << "Shutdown extension server"; extension_server->Shutdown(); +#if !defined(TIZEN_PRODUCT_TV) + // Hide the window object for preventing the white screen + // during termination of web application. + evas_object_hide(window_->evas_object()); + Exit(); +#endif } else if (current != view_stack_.front()) { view_stack_.front()->SetVisibility(true); window_->SetContent(view_stack_.front()->evas_object()); @@ -840,6 +846,7 @@ void WebApplication::OnClosedWebView(WebView* view) { view->ReplyToJavascriptDialog(); RemoveWebViewFromStack(view); +#if defined(TIZEN_PRODUCT_TV) LOGGER(DEBUG) << "plugin_session_count : " << XWalkExtensionRendererController::plugin_session_count; @@ -852,6 +859,7 @@ void WebApplication::OnClosedWebView(WebView* view) { CheckPluginSession, &session_counter); if (!session_counter.timer) LOGGER(ERROR) << "It's failed to create session_counter timer"; +#endif } void WebApplication::OnReceivedWrtMessage(WebView* view, -- 2.7.4