[M120 Migration] [WRTjs][VD] set screen solution for ultra width screen products 30/309530/2
authorzhaosy <shiyusy.zhao@samsung.com>
Mon, 8 Apr 2024 02:13:21 +0000 (10:13 +0800)
committerBot Blink <blinkbot@samsung.com>
Wed, 17 Apr 2024 05:55:34 +0000 (05:55 +0000)
For ultra width screen products(21:9 or 32:9), if app has
"base_screen_resolution" metadata, when app is launched,
window system will change window to 2580*1080 or 3840*1080.
But view is not updated, so app still is displayed as 1920*1080.

So when app is launched, set screen solution again.

Refer to:
  https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/309239/

Change-Id: I477751d76e7eefc4547473b465341ae6129cb370
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
(cherry picked from commit eada7d7929f6d8a1e0fd9d0bac1d92b9078a4715)

tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h
wrt/src/browser/tv/wrt_native_window_tv.cc

index 5df11cb..840af03 100644 (file)
@@ -30,6 +30,11 @@ std::vector<EflScreen*> screen_list;
 }  // namespace
 
 // static
+void EflScreen::ClearCachedDisplaySize() {
+  screen_width = screen_height = 0;
+}
+
+// static
 gfx::Rect EflScreen::GetDisplaySize() {
   if (!screen_width || !screen_height) {
 #if defined(USE_WAYLAND)
index ba37c4b..c5ce65d 100644 (file)
@@ -21,6 +21,7 @@ namespace ui {
 class EflScreen : public PlatformScreen {
  public:
   static gfx::Rect GetDisplaySize();
+  static void ClearCachedDisplaySize();
 
   EflScreen();
 
index e6107c2..d7aba22 100644 (file)
@@ -80,6 +80,8 @@ const char* kProxyVconfKey = "memory/dnet/proxy";
 const char* kWebAppProxyVconfKey = "db/webapp/proxy";
 
 // metadata
+const char* kBaseScreenResolution =
+    "http://tizen.org/metadata/app_ui_type/base_screen_resolution";
 const char* kDualDecodingWebRTC =
     "http://samsung.com/tv/metadata/dual.decoding.support";
 const char* kContentZoomFill =
@@ -843,6 +845,16 @@ void WRTNativeWindowTV::SetAppMetaDataInfo() {
     LOG(INFO) << "zoom fill is " << zoom_fill;
     menu_zoom_fill_ = meta_data_info.GetValue(kContentZoomFill);
   }
+
+  auto base_screen_resolution = meta_data_info.GetValue(kBaseScreenResolution);
+  if (!base_screen_resolution.empty() &&
+      !meta_data_info.HasKey(kScreenResolution)) {
+    LOG(INFO) << "base screen resolution is " << base_screen_resolution;
+    int width = 1920, height = 1080;
+    ui::EflScreen::ClearCachedDisplaySize();
+    GetScreenResolution(width, height);
+    SetScreenResolution(width, height);
+  }
 }
 
 void WRTNativeWindowTV::SetAppMetaDataInfoRelatedWindow() {