mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-22 21:16:40 -04:00
修复windows rect与surface rect大小不一致导致窗口大小异常问题
Signed-off-by: xingyanan <xingyanan2@huawei.com> Change-Id: I30eddead8b0bdf810238fb2de60d1ee875c2e2d9 Signed-off-by: xingyanan <xingyanan2@huawei.com>
This commit is contained in:
@@ -635,15 +635,15 @@ WMError WindowImpl::Show()
|
||||
if (property_->GetWindowType() == WindowType::WINDOW_TYPE_DESKTOP) {
|
||||
WLOGFI("desktop window [id:%{public}d] is shown, minimize all app windows", property_->GetWindowId());
|
||||
SingletonContainer::Get<WindowAdapter>().MinimizeAllAppWindows(property_->GetDisplayId());
|
||||
for (auto& listener : lifecycleListeners_) {
|
||||
if (listener != nullptr) {
|
||||
listener->AfterForeground();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
WLOGFI("window is already shown id: %{public}d, raise to top", property_->GetWindowId());
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessWindowTouchedEvent(property_->GetWindowId());
|
||||
}
|
||||
for (auto& listener : lifecycleListeners_) {
|
||||
if (listener != nullptr) {
|
||||
listener->AfterForeground();
|
||||
}
|
||||
}
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
SetDefaultOption();
|
||||
|
||||
@@ -231,8 +231,12 @@ void WindowLayoutPolicyCascade::UpdateLayoutRect(sptr<WindowNode>& node)
|
||||
LimitWindowSize(node, displayRect_, winRect);
|
||||
node->SetLayoutRect(winRect);
|
||||
CalcAndSetNodeHotZone(winRect, node);
|
||||
|
||||
if (IsLayoutChanged(lastRect, winRect) || node->GetWindowType() == WindowType::WINDOW_TYPE_DOCK_SLICE) {
|
||||
node->GetWindowToken()->UpdateWindowRect(winRect, node->GetWindowSizeChangeReason());
|
||||
}
|
||||
// update node bounds
|
||||
if (node->surfaceNode_ != nullptr) {
|
||||
node->surfaceNode_->SetBounds(winRect.posX_, winRect.posY_, winRect.width_, winRect.height_);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user