mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
modify split
Signed-off-by: l00574490 <liuqi149@huawei.com> Change-Id: I51c249044496e4220121819d0f479a14909e15b9
This commit is contained in:
@@ -49,6 +49,7 @@ public:
|
||||
const sptr<WindowNode>& appNode, const sptr<WindowNode>& aboveAppNode);
|
||||
~WindowLayoutPolicy() = default;
|
||||
void UpdateDisplayInfo(const Rect& primaryRect, const Rect& secondaryRect, const Rect& displayRect);
|
||||
void UpdateSplitInfo(const Rect& primaryRect, const Rect& secondaryRect);
|
||||
void AddWindowNode(sptr<WindowNode>& node);
|
||||
void RemoveWindowNode(sptr<WindowNode>& node);
|
||||
void UpdateWindowNode(sptr<WindowNode>& node);
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
std::shared_ptr<RSDisplayNode> GetDisplayNode() const;
|
||||
void LayoutDividerWindow(sptr<WindowNode>& node);
|
||||
void UpdateDisplayInfo();
|
||||
void UpdateSplitInfo();
|
||||
bool isVerticalDisplay() const;
|
||||
|
||||
class DisplayRects : public RefBase {
|
||||
|
||||
@@ -47,6 +47,17 @@ void WindowLayoutPolicy::UpdateDisplayInfo(const Rect& primaryRect,
|
||||
UpdateDefaultFoatingRect();
|
||||
}
|
||||
|
||||
void WindowLayoutPolicy::UpdateSplitInfo(const Rect& primaryRect, const Rect& secondaryRect)
|
||||
{
|
||||
dependRects.priRect_ = primaryRect;
|
||||
dependRects.secRect_ = secondaryRect;
|
||||
dependRects.limitPriRect_ = dependRects.priRect_;
|
||||
dependRects.limitSecRect_ = dependRects.secRect_;
|
||||
|
||||
UpdateSplitLimitRect(dependRects.limitFullRect_, dependRects.limitPriRect_);
|
||||
UpdateSplitLimitRect(dependRects.limitFullRect_, dependRects.limitSecRect_);
|
||||
}
|
||||
|
||||
void WindowLayoutPolicy::LayoutWindowTree()
|
||||
{
|
||||
InitLimitRects();
|
||||
@@ -131,7 +142,6 @@ void WindowLayoutPolicy::RemoveWindowNode(sptr<WindowNode>& node)
|
||||
if (avoidTypes_.find(type) != avoidTypes_.end()) {
|
||||
LayoutWindowTree();
|
||||
} else if (type == WindowType::WINDOW_TYPE_DOCK_SLICE) { // split screen mode
|
||||
// TODO: change split screen
|
||||
LayoutWindowTree();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,6 +517,14 @@ void WindowNodeContainer::UpdateDisplayInfo()
|
||||
layoutPolicy_->UpdateDisplayInfo(primaryRect, secondaryRect, displayRect);
|
||||
}
|
||||
|
||||
void WindowNodeContainer::UpdateSplitInfo()
|
||||
{
|
||||
// update for split
|
||||
const Rect& primaryRect = displayRects_->GetRectByWindowMode(WindowMode::WINDOW_MODE_SPLIT_PRIMARY);
|
||||
const Rect& secondaryRect = displayRects_->GetRectByWindowMode(WindowMode::WINDOW_MODE_SPLIT_SECONDARY);
|
||||
layoutPolicy_->UpdateSplitInfo(primaryRect, secondaryRect);
|
||||
}
|
||||
|
||||
void WindowNodeContainer::LayoutDividerWindow(sptr<WindowNode>& node)
|
||||
{
|
||||
layoutPolicy_->UpdateLayoutRect(node);
|
||||
@@ -709,7 +717,7 @@ WMError WindowNodeContainer::HandleModeChangeToSplit(sptr<WindowNode>& triggerNo
|
||||
displayRects_->SetSplitRect(DEFAULT_SPLIT_RATIO);
|
||||
SendSplitScreenEvent(triggerNode->GetWindowMode());
|
||||
}
|
||||
UpdateDisplayInfo();
|
||||
UpdateSplitInfo();
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user