!5775 【需求】分屏下子窗和模态适配

Merge pull request !5775 from z00818965/master
This commit is contained in:
openharmony_ci 2024-04-18 09:04:26 +00:00 committed by Gitee
commit dd5c4cf616
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1119,6 +1119,16 @@ WMError WindowSceneSessionImpl::MoveTo(int32_t x, int32_t y)
}
const auto& windowRect = GetRect();
const auto& requestRect = GetRequestRect();
if (WindowHelper::IsSubWindow(GetType())) {
auto mainWindow = FindMainWindowWithContext();
if (mainWindow != nullptr && (mainWindow->GetMode() == WindowMode::WINDOW_MODE_SPLIT_SECONDARY ||
mainWindow->GetMode() == WindowMode::WINDOW_MODE_SPLIT_PRIMARY)) {
if (requestRect.posX_ == x && requestRect.posX_ == y) {
TLOGW(WmsLogTag::WMS_LAYOUT, "Request same position in multiWindow will not update");
return WMError::WM_OK;
}
}
}
Rect newRect = { x, y, requestRect.width_, requestRect.height_ }; // must keep x/y
TLOGI(WmsLogTag::WMS_LAYOUT, "Id:%{public}d, state: %{public}d, type: %{public}d, mode: %{public}d, requestRect: "
"[%{public}d, %{public}d, %{public}d, %{public}d], windowRect: [%{public}d, %{public}d, "
@ -1242,6 +1252,18 @@ WMError WindowSceneSessionImpl::Resize(uint32_t width, uint32_t height)
const auto& windowRect = GetRect();
const auto& requestRect = GetRequestRect();
if (WindowHelper::IsSubWindow(GetType())) {
auto mainWindow = FindMainWindowWithContext();
if (mainWindow != nullptr && (mainWindow->GetMode() == WindowMode::WINDOW_MODE_SPLIT_SECONDARY ||
mainWindow->GetMode() == WindowMode::WINDOW_MODE_SPLIT_PRIMARY)) {
if (width == requestRect.width_ && height == requestRect.height_) {
TLOGW(WmsLogTag::WMS_LAYOUT, "Request same size in multiWindow will not update, return");
return WMError::WM_OK;
}
}
}
Rect newRect = { requestRect.posX_, requestRect.posY_, width, height }; // must keep w/h
TLOGI(WmsLogTag::WMS_LAYOUT, "Id:%{public}d, state: %{public}d, type: %{public}d, mode: %{public}d, requestRect: "
"[%{public}d, %{public}d, %{public}d, %{public}d], windowRect: [%{public}d, %{public}d, "