[WRTjs][VD] Conformant is not working for 4K resolution IME 54/315854/4
authorzhaosy <shiyusy.zhao@samsung.com>
Thu, 5 Dec 2024 07:41:42 +0000 (15:41 +0800)
committerBot Blink <blinkbot@samsung.com>
Fri, 6 Dec 2024 02:18:42 +0000 (02:18 +0000)
In 25's OscarP product, IME is changed to 4K resolution(3840*1024),
but webapp resolution still is 1920*1080, so webapp can't subtract IME size.
Thus app input-box is overlapped by IME.

So for 4k IME, IME resolution should be divided by 2, then subtract IME size.

Change-Id: I1f3bb8ed777b63d82f80e47d63681017696ef0d4
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
packaging/chromium-efl.spec
wrt/src/base/platform_info.cc
wrt/src/base/platform_info.h
wrt/src/browser/wrt_native_window_on_screen.cc

index cae3670227c36811fcdc9c4e58761065a755bf88..97d205cb1701d5d56c935095a897df5e03caa973 100644 (file)
@@ -314,6 +314,7 @@ BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-network-bluetooth)
 BuildRequires: pkgconfig(capi-network-bluetooth-tv)
 BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(feature-config-enum-header)
 BuildRequires: pkgconfig(graphics-control)
 BuildRequires: pkgconfig(security-privilege-manager)
 BuildRequires: pkgconfig(drmdecrypt)
index 815788c8424ea68de5ad0ad58d34698f48882dbe..890a0fe7c35195e93d2db7e40949ff674ff758bd 100644 (file)
@@ -22,6 +22,7 @@
 
 #if BUILDFLAG(IS_TIZEN_TV)
 #include <display-rotator-api.h>
+#include <feature_config_enum.h>
 #include <sensor.h>
 
 #include "base/files/file_util.h"
@@ -376,6 +377,25 @@ bool IsLiteMemoryBoard() {
   return is_lite_memory_board.value();
 }
 
+#if TIZEN_VERSION_AT_LEAST(9, 0, 0)
+int GetIMEResolution() {
+  static absl::optional<int> ime_resolution;
+  if (ime_resolution.has_value())
+    return ime_resolution.value();
+
+  int resolution = FMS_IME_RESOLUTION_2K;
+  if (SYSTEM_INFO_ERROR_NONE !=
+      system_info_get_custom_int("com.samsung/featureconf/ime.resolution",
+                                 &resolution)) {
+    LOG(ERROR) << "Fail to get system info: ime.resolution";
+  }
+  LOG(INFO) << "ime.resolution : " << resolution;
+  ime_resolution = resolution;
+
+  return ime_resolution.value();
+}
+#endif
+
 #endif
 
 }  // namespace wrt
index 6aaa6d05bba7e9ff5d358cd26e11a149b99f2993..42b40ed60871ce3b326fa6b2fbb3bc32fd0e3111 100644 (file)
@@ -77,6 +77,9 @@ bool IsMouseCursorSupportedModel();
 bool IsDisplayRotatorSupported();
 bool IsSensorSupported();
 bool IsLiteMemoryBoard();
+#if TIZEN_VERSION_AT_LEAST(9, 0, 0)
+int GetIMEResolution();
+#endif
 #endif
 
 }  // namespace wrt
index e5c4ac8a923c3259dcb10e25b7229a688a4b1652..4562d342ccfd633c49d44d4516b1740aedb68755 100644 (file)
@@ -8,6 +8,7 @@
 #include <Ecore_Wl2.h>
 
 #include "base/task/single_thread_task_runner.h"
+#include "build/tizen_version.h"
 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
 #include "ui/views/view.h"
 #include "ui/views/widget/native_widget_private.h"
 #include "wrt/src/browser/wrt_native_widget.h"
 #include "wrt/src/browser/wrt_window_tree_host.h"
 
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(9, 0, 0)
+#include <feature_config_enum.h>
+
+#include "wrt/src/base/platform_info.h"
+#endif
+
 namespace wrt {
 
 WRTNativeWindowOnScreen::WRTNativeWindowOnScreen() {
@@ -190,6 +197,14 @@ void WRTNativeWindowOnScreen::OnConformantChange() {
         ECORE_WL2_VIRTUAL_KEYBOARD_STATE_ON) {
       ecore_wl2_window_keyboard_geometry_get(
           wl2_window, &x, &y, &width, &height);
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(9, 0, 0)
+      if (GetIMEResolution() == FMS_IME_RESOLUTION_4K) {
+        x /= 2;
+        y /= 2;
+        width /= 2;
+        height /= 2;
+      }
+#endif
       rect.Subtract(gfx::Rect(x, y, width, height));
     }
     if (ecore_wl2_window_clipboard_state_get(wl2_window) ==