修复告警

Signed-off-by: xingyanan <xingyanan2@huawei.com>
Change-Id: I9f5aa51b289ac901021fcad78f6c3d2788ff0a08
This commit is contained in:
xingyanan
2022-03-21 10:46:37 +08:00
parent 3a48b8ffab
commit 1bef4af525
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -57,7 +57,10 @@ bool WindowInfo::Marshalling(Parcel &parcel) const
WindowInfo* WindowInfo::Unmarshalling(Parcel &parcel)
{
WindowInfo* windowInfo = new WindowInfo();
WindowInfo* windowInfo = new (std::nothrow) WindowInfo();
if (windowInfo == nullptr) {
return nullptr;
}
bool res = parcel.ReadInt32(windowInfo->wid_) && parcel.ReadUint32(windowInfo->windowRect_.width_) &&
parcel.ReadUint32(windowInfo->windowRect_.height_) && parcel.ReadInt32(windowInfo->windowRect_.posX_) &&
parcel.ReadInt32(windowInfo->windowRect_.posY_) && parcel.ReadBool(windowInfo->focused_);
+1 -1
View File
@@ -294,7 +294,7 @@ void WindowController::ProcessDisplayChange(DisplayId displayId, DisplayStateCha
uint32_t height = static_cast<uint32_t>(displayInfo->GetHeight() * SYSTEM_BAR_HEIGHT_RATIO);
Rect newRect = { 0, 0, width, height };
ResizeRect(sysBarWinId_[WindowType::WINDOW_TYPE_STATUS_BAR], newRect, WindowSizeChangeReason::DRAG);
newRect = { 0, displayInfo->GetHeight() - height, width, height };
newRect = { 0, displayInfo->GetHeight() - static_cast<int32_t>(height), width, height };
ResizeRect(sysBarWinId_[WindowType::WINDOW_TYPE_NAVIGATION_BAR], newRect, WindowSizeChangeReason::DRAG);
break;
}