Revert "[WRTjs][VD] Add a rect to restrict the size of window" 03/291603/3
authorzhao shiyu <shiyusy.zhao@samsung.com>
Wed, 19 Apr 2023 06:21:22 +0000 (06:21 +0000)
committerzhao shiyu <shiyusy.zhao@samsung.com>
Wed, 19 Apr 2023 06:28:47 +0000 (06:28 +0000)
This reverts commit 34c50bf44debe9dcb965daacb299f17abb361ff9.

This patch cause e-pop layout is not correct, so revert this patch

Change-Id: I89b289687ded986b82f3d0385bd7a24472985155

wrt/src/browser/tv/wrt_native_window_tv.cc
wrt/src/browser/tv/wrt_native_window_tv.h [changed mode: 0644->0755]
wrt/src/browser/wrt_native_window.cc
wrt/src/browser/wrt_native_window.h

index 1649fc6b26cb0a6c94e19331118eaf91cf64e391..c6c5ea62588d4f555e382379b07317d90ec471f0 100644 (file)
@@ -365,8 +365,6 @@ void WRTNativeWindowTV::Initialize(content::WebContents* web_contents) {
   SetRuntimeVariables();
   SetProxyInfo();
   SetDiskCacheMode();
-
-  SetMaxWindowSizeRect();
 }
 
 void WRTNativeWindowTV::Finalize() {
@@ -484,16 +482,6 @@ void WRTNativeWindowTV::CreateMouseCursor(Evas_Object* window) {
   mouse_initialize = true;
 }
 
-void WRTNativeWindowTV::SetMaxWindowSizeRect() {
-  // window is resized to 1920*1920 by efl in some rotation cases(IME is
-  // showing, rotate). so add a rect to restrict the size of window.
-  window_size_rect_ =
-      evas_object_rectangle_add(evas_object_evas_get(top_window_));
-  evas_object_size_hint_min_set(window_size_rect_, predefined_screen_width,
-                                predefined_screen_height);
-  elm_win_resize_object_add(top_window_, window_size_rect_);
-}
-
 // static
 void WRTNativeWindowTV::SetGlobalResourceId(Evas_Object* top_window) {
   if (global_resource_id)
@@ -1565,17 +1553,10 @@ void WRTNativeWindowTV::DidRotation(int degree) {
   if (abs(origin_degree - degree) != 180 && rwhv)
     rwhv->ClearAllTilesResources();
 
-  int screen_width = 1920, screen_height = 1080;
-  GetScreenResolution(screen_width, screen_height);
-  if (degree == 90 || degree == 270) {
-    evas_object_size_hint_min_set(window_size_rect_, screen_height,
-                                  screen_width);
-    evas_object_resize(view_evas(), screen_height, screen_width);
-  } else {
-    evas_object_size_hint_min_set(window_size_rect_, screen_width,
-                                  screen_height);
-    evas_object_resize(view_evas(), screen_width, screen_width);
-  }
+  int w, h;
+  evas_object_geometry_get(top_window_, nullptr, nullptr, &w, &h);
+  evas_object_resize(top_window_, w, h);
+  LOG(INFO) << "degree : " << degree << " (" << w << "x" << h << ")";
 }
 
 void WRTNativeWindowTV::LowerWindow() {
old mode 100644 (file)
new mode 100755 (executable)
index 90947df..45c1b64
@@ -107,7 +107,6 @@ class WRTNativeWindowTV : public WRTNativeWindow {
   void SetInvisibleDelivery();
   void SetKeyboardFuncKey();
   void SetKeyEventChecker();
-  void SetMaxWindowSizeRect();
   void SetProxyInfo();
   void SetDiskCacheMode();
   void SetRuntimeVariables();
@@ -148,7 +147,6 @@ class WRTNativeWindowTV : public WRTNativeWindow {
   sensor_listener_h rotation_listener_;
 
   Evas_Object* top_window_;
-  Evas_Object* window_size_rect_;
 
   electron::WebContentsZoomController* zoom_controller_ = nullptr;
   double zoom_factor_ = 1.0;
index d43ff97f3bb265daa18f39dde031da47b55cdbec..fca24b87b061c983c9dd483c8082cb3528a1fabc 100644 (file)
@@ -103,6 +103,8 @@ const std::string kViewmodeTypeWindowed = "windowed";
 #endif
 
 Ecore_Event_Handler* visibility_handler_ = nullptr;
+int predefined_screen_width = 0;
+int predefined_screen_height = 0;
 
 void SetVisibilityCallback(Evas_Object* top_window) {
   LOG(INFO) << "Set callbacks for visibility change";
@@ -170,9 +172,6 @@ Evas_Object* WRTNativeWindow::window_ = nullptr;
 Evas_Object* WRTNativeWindow::layout_ = nullptr;
 Evas_Object* WRTNativeWindow::conformant_ = nullptr;
 
-int WRTNativeWindow::predefined_screen_width = 0;
-int WRTNativeWindow::predefined_screen_height = 0;
-
 // static
 WRTNativeWindow* WRTNativeWindow::GetMainNativeWindow() {
   return electron::WindowList::IsEmpty()
index 4dfeecd117a98232682e63792451e1739e37dd0c..fc91fbee6667329883c185690500f0b6103da8b0 100644 (file)
@@ -172,9 +172,6 @@ class WRTNativeWindow : public electron::NativeWindow {
   bool is_enabled_ = true;
   content::WebContents* web_contents_;
 
-  static int predefined_screen_width;
-  static int predefined_screen_height;
-
  private:
   static void OnHWBackKey(void*, Evas_Object*, void*);
   static void OnHWMoreKey(void*, Evas_Object*, void*);