From 3256073c83135f3b3329b4c02e4314b780b557ad Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Mon, 22 May 2023 15:30:22 +0900 Subject: [PATCH] Remove the redundancy for geometry calculate function The geometry calculate is needed from client to displayer server module. The calcuate function is needed when window is resized, moved and set the input region. For that, the calculated function is existed twice. This patch is to remove one of them. Change-Id: I87ff260b0e31475735c80c3e144bd1a68e3ad907 --- .../ecore-wl2/window-base-ecore-wl2.cpp | 41 ++-------------------- .../ecore-wl2/window-base-ecore-wl2.h | 14 -------- 2 files changed, 3 insertions(+), 52 deletions(-) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 812ecfe..ad40012 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -2249,44 +2249,9 @@ unsigned int WindowBaseEcoreWl2::GetAuxiliaryHintId(const std::string& hint) con return 0; } -Rect WindowBaseEcoreWl2::RecalculateInputRect(const Rect& rect) -{ - Rect newRect; - - if(mWindowRotationAngle == 90) - { - newRect.x = rect.y; - newRect.y = mWindowPositionSize.height - (rect.x + rect.width); - newRect.width = rect.height; - newRect.height = rect.width; - } - else if(mWindowRotationAngle == 180) - { - newRect.x = mWindowPositionSize.width - (rect.x + rect.width); - newRect.y = mWindowPositionSize.height - (rect.y + rect.height); - newRect.width = rect.width; - newRect.height = rect.height; - } - else if(mWindowRotationAngle == 270) - { - newRect.x = mWindowPositionSize.width - (rect.y + rect.height); - newRect.y = rect.x; - newRect.width = rect.height; - newRect.height = rect.width; - } - else - { - newRect.x = rect.x; - newRect.y = rect.y; - newRect.width = rect.width; - newRect.height = rect.height; - } - return newRect; -} - void WindowBaseEcoreWl2::SetInputRegion(const Rect& inputRegion) { - Rect convertRegion = RecalculateInputRect(inputRegion); + Rect convertRegion = RecalculatePositionSizeToSystem(inputRegion); Eina_Rectangle rect; rect.x = convertRegion.x; @@ -3140,7 +3105,7 @@ bool WindowBaseEcoreWl2::IsFloatingModeEnabled() const void WindowBaseEcoreWl2::IncludeInputRegion(const Rect& inputRegion) { - Rect convertRegion = RecalculateInputRect(inputRegion); + Rect convertRegion = RecalculatePositionSizeToSystem(inputRegion); Eina_Rectangle rect; rect.x = convertRegion.x; @@ -3157,7 +3122,7 @@ void WindowBaseEcoreWl2::IncludeInputRegion(const Rect& inputRegion) void WindowBaseEcoreWl2::ExcludeInputRegion(const Rect& inputRegion) { - Rect convertRegion = RecalculateInputRect(inputRegion); + Rect convertRegion = RecalculatePositionSizeToSystem(inputRegion); Eina_Rectangle rect; rect.x = convertRegion.x; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index af8054f..b70afbc 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -600,20 +600,6 @@ private: */ PositionSize RecalculatePositionSizeToCurrentOrientation(PositionSize positionSize); - /** - * @brief Return the rect value to recalulate with the default system coordinates. - * - * Some native window APIs work the geometry value based on the default system coordinates. - * IncludeInputRegion() and ExcludeInputRegion() are one of them. - * When the window is rotated, current window's geometry already were set with the rotated angle. - * If IncludeInputRegion() or ExcludeInputRegion() are called with rotated angle by application, - * the rect's area should be re-calcuated on the default system coordinates. - * - * @param[in] rect the window's current position and size with current window rotation angle. - * @return the re-calculated rect on the default system coordinates. - */ - Rect RecalculateInputRect(const Rect& rect); - protected: // Undefined WindowBaseEcoreWl2(const WindowBaseEcoreWl2&) = delete; -- 2.7.4