mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-22 04:55:33 -04:00
fix recent snapshot bug
Signed-off-by: jincanran <jincanran@huawei.com> Change-Id: I767e934c72d73d16dcae81b40d0e7662161ce6fe
This commit is contained in:
@@ -65,6 +65,7 @@ protected:
|
||||
void SetRectForFloating(const sptr<WindowNode>& node);
|
||||
Rect ComputeDecoratedWindowRect(const Rect& winRect);
|
||||
bool IsVertical() const;
|
||||
bool IsFullScreenRecentWindowExist() const;
|
||||
Rect defaultFloatingRect_ = { 0, 0, 0, 0 };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -57,10 +57,13 @@ void WindowLayoutPolicy::Reorder()
|
||||
void WindowLayoutPolicy::LayoutWindowTree()
|
||||
{
|
||||
limitRect_ = displayRect_;
|
||||
std::vector<sptr<WindowNode>> rootNodes = { aboveAppWindowNode_, appWindowNode_, belowAppWindowNode_ };
|
||||
for (auto& node : rootNodes) { // ensure that the avoid area windows are traversed first
|
||||
LayoutWindowNode(node);
|
||||
LayoutWindowNode(aboveAppWindowNode_); // ensure that the avoid area windows are traversed first
|
||||
if (IsFullScreenRecentWindowExist()) {
|
||||
WLOGFI("recent window on top, early exit layout tree");
|
||||
return;
|
||||
}
|
||||
LayoutWindowNode(appWindowNode_);
|
||||
LayoutWindowNode(belowAppWindowNode_);
|
||||
}
|
||||
|
||||
void WindowLayoutPolicy::LayoutWindowNode(sptr<WindowNode>& node)
|
||||
@@ -382,6 +385,17 @@ float WindowLayoutPolicy::GetVirtualPixelRatio() const
|
||||
return virtualPixelRatio;
|
||||
}
|
||||
|
||||
bool WindowLayoutPolicy::IsFullScreenRecentWindowExist() const
|
||||
{
|
||||
for (auto& childNode : aboveAppWindowNode_->children_) {
|
||||
if (childNode->GetWindowType() == WindowType::WINDOW_TYPE_LAUNCHER_RECENT &&
|
||||
childNode->GetWindowMode() == WindowMode::WINDOW_MODE_FULLSCREEN) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Rect WindowLayoutPolicy::GetDisplayLimitRect() const
|
||||
{
|
||||
return limitRect_;
|
||||
|
||||
@@ -86,10 +86,7 @@ void WindowLayoutPolicyCascade::LayoutWindowNode(sptr<WindowNode>& node)
|
||||
void WindowLayoutPolicyCascade::LayoutWindowTree()
|
||||
{
|
||||
InitLimitRects();
|
||||
std::vector<sptr<WindowNode>> rootNodes = { aboveAppWindowNode_, appWindowNode_, belowAppWindowNode_ };
|
||||
for (auto& node : rootNodes) { // ensure that the avoid area windows are traversed first
|
||||
LayoutWindowNode(node);
|
||||
}
|
||||
WindowLayoutPolicy::LayoutWindowTree();
|
||||
}
|
||||
|
||||
void WindowLayoutPolicyCascade::UpdateWindowNode(sptr<WindowNode>& node, bool isAddWindow)
|
||||
|
||||
Reference in New Issue
Block a user