diff --git a/test/systemtest/wms/window_test_utils.cpp b/test/systemtest/wms/window_test_utils.cpp index 17e514101d..70478ecb39 100755 --- a/test/systemtest/wms/window_test_utils.cpp +++ b/test/systemtest/wms/window_test_utils.cpp @@ -159,12 +159,8 @@ Rect WindowTestUtils::CalcLimitedRect(const Rect& rect, float virtualPixelRatio) { constexpr uint32_t maxLimitLen = 2560; constexpr int32_t maxPosRemain = 48; - uint32_t minVerticalFloatingW = static_cast(MIN_VERTICAL_FLOATING_WIDTH * virtualPixelRatio); - uint32_t minVerticalFloatingH = static_cast(MIN_VERTICAL_FLOATING_HEIGHT * virtualPixelRatio); - - bool vertical = displayRect_.width_ < displayRect_.height_; - uint32_t minFloatingW = vertical ? minVerticalFloatingW : minVerticalFloatingH; - uint32_t minFloatingH = vertical ? minVerticalFloatingH : minVerticalFloatingW; + uint32_t minFloatingW = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); + uint32_t minFloatingH = static_cast(MIN_FLOATING_HEIGHT * virtualPixelRatio); Rect resRect = { std::min(std::max(rect.posX_, maxPosRemain - static_cast(rect.width_)), static_cast(displayRect_.width_) - maxPosRemain), @@ -177,12 +173,8 @@ Rect WindowTestUtils::CalcLimitedRect(const Rect& rect, float virtualPixelRatio) Rect WindowTestUtils::GetFloatingLimitedRect(const Rect& rect, float virtualPixelRatio) { - uint32_t minVerticalFloatingW = static_cast(MIN_VERTICAL_FLOATING_WIDTH * virtualPixelRatio); - uint32_t minVerticalFloatingH = static_cast(MIN_VERTICAL_FLOATING_HEIGHT * virtualPixelRatio); - bool vertical = displayRect_.width_ < displayRect_.height_; - - uint32_t minFloatingW = vertical ? minVerticalFloatingW : minVerticalFloatingH; - uint32_t minFloatingH = vertical ? minVerticalFloatingH : minVerticalFloatingW; + uint32_t minFloatingW = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); + uint32_t minFloatingH = static_cast(MIN_FLOATING_HEIGHT * virtualPixelRatio); Rect resRect = { rect.posX_, rect.posY_, @@ -208,7 +200,6 @@ Rect WindowTestUtils::GetDecorateRect(const Rect& rect, float virtualPixelRatio) void WindowTestUtils::InitByDisplayRect(const Rect& displayRect) { const float barRatio = 0.07; - const float appRation = 0.6; const float spaceRation = 0.125; displayRect_ = displayRect; limitDisplayRect_ = displayRect; @@ -221,8 +212,8 @@ void WindowTestUtils::InitByDisplayRect(const Rect& displayRect) customAppRect_ = { displayRect_.width_ * spaceRation, displayRect_.height_ * spaceRation, - displayRect_.width_ * appRation, - displayRect_.height_ * appRation + displayRect_.width_ * DEFAULT_ASPECT_RATIO, + displayRect_.height_ * DEFAULT_ASPECT_RATIO }; } @@ -248,8 +239,7 @@ uint32_t WindowTestUtils::GetMaxTileWinNum() constexpr uint32_t half = 2; uint32_t edgeIntervalVp = static_cast(EDGE_INTERVAL * half * virtualPixelRatio); uint32_t midIntervalVp = static_cast(MID_INTERVAL * virtualPixelRatio); - uint32_t minFloatingW = isVerticalDisplay_ ? MIN_VERTICAL_FLOATING_WIDTH : MIN_VERTICAL_FLOATING_HEIGHT; - minFloatingW = static_cast(minFloatingW * virtualPixelRatio); + uint32_t minFloatingW = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); uint32_t drawableW = limitDisplayRect_.width_ - edgeIntervalVp + midIntervalVp; uint32_t maxNum = static_cast(drawableW / (minFloatingW + midIntervalVp)); WLOGFI("maxNum: %{public}d", maxNum); diff --git a/utils/include/window_helper.h b/utils/include/window_helper.h index 0188fda6da..3e70035ca6 100644 --- a/utils/include/window_helper.h +++ b/utils/include/window_helper.h @@ -207,17 +207,12 @@ public: static Rect GetFixedWindowRectByLimitSize(const Rect& oriDstRect, const Rect& lastRect, bool isVertical, float virtualPixelRatio) { - uint32_t minVerticalFloatingW = static_cast(MIN_VERTICAL_FLOATING_WIDTH * virtualPixelRatio); - uint32_t minVerticalFloatingH = static_cast(MIN_VERTICAL_FLOATING_HEIGHT * virtualPixelRatio); + uint32_t minFloatingW = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); + uint32_t minFloatingH = static_cast(MIN_FLOATING_HEIGHT * virtualPixelRatio); Rect dstRect = oriDstRect; // fix minimum size - if (isVertical) { - dstRect.width_ = std::max(minVerticalFloatingW, oriDstRect.width_); - dstRect.height_ = std::max(minVerticalFloatingH, oriDstRect.height_); - } else { - dstRect.width_ = std::max(minVerticalFloatingH, oriDstRect.width_); - dstRect.height_ = std::max(minVerticalFloatingW, oriDstRect.height_); - } + dstRect.width_ = std::max(minFloatingW, oriDstRect.width_); + dstRect.height_ = std::max(minFloatingH, oriDstRect.height_); // fix maximum size dstRect.width_ = std::min(static_cast(MAX_FLOATING_SIZE * virtualPixelRatio), dstRect.width_); diff --git a/utils/include/wm_common_inner.h b/utils/include/wm_common_inner.h index 957994dc4b..2d5298a4f9 100644 --- a/utils/include/wm_common_inner.h +++ b/utils/include/wm_common_inner.h @@ -326,7 +326,7 @@ struct AbilityInfo { namespace { constexpr float DEFAULT_SPLIT_RATIO = 0.5; - constexpr float DEFAULT_ASPECT_RATIO = 0.66; + constexpr float DEFAULT_ASPECT_RATIO = 0.67; constexpr float DISPLAY_ZOOM_OFF_SCALE = 1.0; constexpr float DISPLAY_ZOOM_MIN_SCALE = 2.0; constexpr float DISPLAY_ZOOM_MAX_SCALE = 8.0; @@ -337,8 +337,8 @@ namespace { constexpr uint32_t WINDOW_FRAME_CORNER_WIDTH = 16; // the frame width of corner constexpr uint32_t HOTZONE_TOUCH = 20; constexpr uint32_t HOTZONE_POINTER = 4; - constexpr uint32_t MIN_VERTICAL_FLOATING_WIDTH = 240; - constexpr uint32_t MIN_VERTICAL_FLOATING_HEIGHT = 320; + constexpr uint32_t MIN_FLOATING_WIDTH = 320; + constexpr uint32_t MIN_FLOATING_HEIGHT = 240; constexpr uint32_t MIN_VERTICAL_SPLIT_HEIGHT = 240; constexpr uint32_t MIN_HORIZONTAL_SPLIT_WIDTH = 320; constexpr uint32_t MAX_FLOATING_SIZE = 2560; diff --git a/wmserver/src/window_layout_policy.cpp b/wmserver/src/window_layout_policy.cpp index 546c24b1b6..ce28576acc 100644 --- a/wmserver/src/window_layout_policy.cpp +++ b/wmserver/src/window_layout_policy.cpp @@ -589,11 +589,8 @@ WindowSizeLimits WindowLayoutPolicy::GetSystemSizeLimits(const sptr& } systemLimits.minHeight_ = static_cast(systemLimits.minWidth_ * hwRatio); } else { - systemLimits.minWidth_ = static_cast(MIN_VERTICAL_FLOATING_WIDTH * virtualPixelRatio); - systemLimits.minHeight_ = static_cast(MIN_VERTICAL_FLOATING_HEIGHT * virtualPixelRatio); - if (displayRect.width_ > displayRect.height_ && !node->isShowingOnMultiDisplays_) { - std::swap(systemLimits.minWidth_, systemLimits.minHeight_); - } + systemLimits.minWidth_ = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); + systemLimits.minHeight_ = static_cast(MIN_FLOATING_HEIGHT * virtualPixelRatio); } WLOGFD("[System SizeLimits] [maxWidth: %{public}u, minWidth: %{public}u, maxHeight: %{public}u, " "minHeight: %{public}u]", systemLimits.maxWidth_, systemLimits.minWidth_, diff --git a/wmserver/src/window_layout_policy_tile.cpp b/wmserver/src/window_layout_policy_tile.cpp index 0a6bf3a255..1937d09c34 100644 --- a/wmserver/src/window_layout_policy_tile.cpp +++ b/wmserver/src/window_layout_policy_tile.cpp @@ -73,8 +73,7 @@ uint32_t WindowLayoutPolicyTile::GetMaxTileWinNum(DisplayId displayId) const constexpr uint32_t half = 2; uint32_t edgeIntervalVp = static_cast(EDGE_INTERVAL * half * virtualPixelRatio); uint32_t midIntervalVp = static_cast(MID_INTERVAL * virtualPixelRatio); - uint32_t minFloatingW = IsVerticalDisplay(displayId) ? MIN_VERTICAL_FLOATING_WIDTH : MIN_VERTICAL_FLOATING_HEIGHT; - minFloatingW = static_cast(minFloatingW * virtualPixelRatio); + uint32_t minFloatingW = static_cast(MIN_FLOATING_WIDTH * virtualPixelRatio); uint32_t drawableW = limitRectMap_[displayId].width_ - edgeIntervalVp + midIntervalVp; return static_cast(drawableW / (minFloatingW + midIntervalVp)); }