From d4211b0eeb7d2a5e03dbd2982f2be35b0ac3d030 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Fri, 6 Jul 2018 09:23:00 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 11/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 12/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 From c114c332d1275faaea3bec7d488a86923229061a Mon Sep 17 00:00:00 2001 From: "surya.kumar7" Date: Fri, 5 Oct 2018 00:05:46 +0530 Subject: [PATCH 13/16] [HOTFIX] Fix crash on closing application from task manager Change-Id: I830713b5fe14523ee967531b560857677abd8d89 Signed-off-by: surya.kumar7 --- runtime/browser/ui_runtime.cc | 2 ++ runtime/browser/web_application.cc | 6 ++++++ runtime/browser/web_application.h | 1 + 3 files changed, 9 insertions(+) diff --git a/runtime/browser/ui_runtime.cc b/runtime/browser/ui_runtime.cc index 45a465a..e549c02 100755 --- a/runtime/browser/ui_runtime.cc +++ b/runtime/browser/ui_runtime.cc @@ -156,6 +156,8 @@ bool UiRuntime::OnCreate() { } void UiRuntime::OnTerminate() { + if (application_) + application_->SimulateBackKeyClosing(); } void UiRuntime::Terminate() { diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 43be4fb..38bb911 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -1047,6 +1047,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { } } +void WebApplication::SimulateBackKeyClosing() { + window_->InActive(); + while (view_stack_.size()) + OnHardwareKey(view_stack_.front(), kKeyNameBack); +} + void WebApplication::OnLanguageChanged() { lang_changed_mode_ = true; locale_manager_->UpdateSystemLocale(); diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 5b247b2..a54208b 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -116,6 +116,7 @@ class WebApplication : public WebView::EventListener { WebApplication* application; Ecore_Timer* timer; } main_loop, session_counter; + void SimulateBackKeyClosing(); private: bool Initialize(); -- 2.7.4 From 1cefc78f8728846e36e5186704aad24ddad9984b Mon Sep 17 00:00:00 2001 From: Prathmesh Manurkar Date: Mon, 8 Oct 2018 10:05:10 +0000 Subject: [PATCH 14/16] Revert "[HOTFIX] Fix crash on closing application from task manager" This reverts commit c114c332d1275faaea3bec7d488a86923229061a. Change-Id: I7274dcdfb50fe433343ffd0bd81e938694b4ab25 --- runtime/browser/ui_runtime.cc | 2 -- runtime/browser/web_application.cc | 6 ------ runtime/browser/web_application.h | 1 - 3 files changed, 9 deletions(-) diff --git a/runtime/browser/ui_runtime.cc b/runtime/browser/ui_runtime.cc index e549c02..45a465a 100755 --- a/runtime/browser/ui_runtime.cc +++ b/runtime/browser/ui_runtime.cc @@ -156,8 +156,6 @@ bool UiRuntime::OnCreate() { } void UiRuntime::OnTerminate() { - if (application_) - application_->SimulateBackKeyClosing(); } void UiRuntime::Terminate() { diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 38bb911..43be4fb 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -1047,12 +1047,6 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { } } -void WebApplication::SimulateBackKeyClosing() { - window_->InActive(); - while (view_stack_.size()) - OnHardwareKey(view_stack_.front(), kKeyNameBack); -} - void WebApplication::OnLanguageChanged() { lang_changed_mode_ = true; locale_manager_->UpdateSystemLocale(); diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index a54208b..5b247b2 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -116,7 +116,6 @@ class WebApplication : public WebView::EventListener { WebApplication* application; Ecore_Timer* timer; } main_loop, session_counter; - void SimulateBackKeyClosing(); private: bool Initialize(); -- 2.7.4 From 1309299e847dd345aae5128037763ceef24f7040 Mon Sep 17 00:00:00 2001 From: "prathmesh.m" Date: Fri, 5 Oct 2018 17:25:35 +0530 Subject: [PATCH 15/16] Handle app exit when triggered from platform - Issue: Crash occured on termination is triggered by platform (Home Key-> Exit all, app_launcher) - Defer the ecore loop quit untill last idler is executed - Lower the elm win instead of hiding the evas object to avoid flickring Change-Id: Idab786b6dd1ee04062433c81811cd9999b19e905 Signed-off-by: prathmesh.m --- runtime/browser/web_application.cc | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 43be4fb..4a8434d 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -62,6 +62,11 @@ #define MAIN_LOOP_INTERVAL 1 static const float FirstFrameDelayWaitTime = 2.0f; +// keeps tracks of the added idlers +int idler_count = 0; +// Identifies the last idler +bool idler_exit_loop = false; + using namespace extensions; namespace runtime { @@ -741,8 +746,13 @@ void WebApplication::ClosePage() { } void WebApplication::Exit() { + // loop begin is called only when app is terminated from platform. + // So do not stop the loop here. Loop needs to be stopped when the + // last view is completely deleted. + // App loop exit is not required in case platform triggers the app + // exit if (!is_terminate_called_) - ecore_main_loop_quit(); + return; switch (app_data_->app_type()) { case common::ApplicationData::AppType::UI: @@ -806,9 +816,12 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { #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()); + window_->InActive(); Exit(); #endif + if (!is_terminate_called_) { + idler_exit_loop = true; + } } else if (current != view_stack_.front()) { view_stack_.front()->SetVisibility(true); window_->SetContent(view_stack_.front()->evas_object()); @@ -817,10 +830,21 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { vc_webview_->vc_webview_set_view(view_stack_.front()->evas_object()); } + // Increment idler count. Will be decremented + // when idler is executed + idler_count++; // Delete after the callback context(for ewk view) was not used ecore_idler_add([](void* view) { WebView* obj = static_cast(view); delete obj; + idler_count--; + if (idler_count == 0 && idler_exit_loop) { + LOGGER(DEBUG) << "Quit Loop on idler done"; + // Quit the loop created by crosswalk during close + // page after making sure this is the last idler that + // is called + ecore_main_loop_quit(); + } return EINA_FALSE; }, view); -- 2.7.4 From 36f38c72a6fedce4829f337e72b9463e162e37f2 Mon Sep 17 00:00:00 2001 From: "k2.nagaraju" Date: Fri, 5 Oct 2018 10:55:02 +0530 Subject: [PATCH 16/16] [SVACE] Fix out of range exception error Change-Id: I6d097c11a1bf64126d6b4212a91b2bbee963c2a7 Signed-off-by: k2.nagaraju --- extensions/renderer/xwalk_extension_module.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/renderer/xwalk_extension_module.cc b/extensions/renderer/xwalk_extension_module.cc index c222556..fa691dc 100644 --- a/extensions/renderer/xwalk_extension_module.cc +++ b/extensions/renderer/xwalk_extension_module.cc @@ -86,8 +86,8 @@ XWalkExtensionModule::~XWalkExtensionModule() { // the iframe), even if we destroy the references we have. v8::Handle function_data = v8::Local::New(isolate, function_data_); - function_data->Delete(v8::String::NewFromUtf8(isolate, - kXWalkExtensionModule)); + function_data.As()->Delete(v8::String::NewFromUtf8(isolate, + kXWalkExtensionModule)); object_template_.Reset(); function_data_.Reset(); -- 2.7.4