[M120 Migration][WRTjs][VD] set screen solution for ultra width screen products 78/308778/3
authorzhaosy <shiyusy.zhao@samsung.com>
Mon, 25 Mar 2024 02:52:30 +0000 (10:52 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 4 Apr 2024 08:49:56 +0000 (08:49 +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.

Reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/308471/

Change-Id: I9de89e1a3aed79a0c1d91ada401f53e4b64a6aed
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
(cherry picked from commit ba2b872240f3148c4f4d00fe7849b1538aac7750)

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 5684d27..27b07cf 100644 (file)
@@ -81,6 +81,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 =
@@ -844,6 +846,15 @@ 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()) {
+    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() {