add mode check for startingWindow

Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
Change-Id: I98844166f19e3aa721870f26f2dd7ec8d169bfc8
This commit is contained in:
chyyy0213
2022-07-05 12:43:25 +08:00
parent c2159aaca7
commit 7b7aa4ffe5
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -59,7 +59,10 @@ sptr<WindowNode> StartingWindow::CreateWindowNode(const sptr<WindowTransitionInf
}
property->SetRequestRect(info->GetWindowRect());
property->SetWindowMode(info->GetWindowMode());
if (WindowHelper::IsValidWindowMode(info->GetWindowMode())) {
property->SetWindowMode(info->GetWindowMode());
}
property->SetDisplayId(info->GetDisplayId());
property->SetWindowType(info->GetWindowType());
property->AddWindowFlag(WindowFlag::WINDOW_FLAG_NEED_AVOID);
+3 -1
View File
@@ -73,7 +73,9 @@ void WindowController::StartingWindow(sptr<WindowTransitionInfo> info, sptr<Medi
WLOGFE("windowNode exists but is cold start!");
return;
}
if (node->GetWindowMode() != info->GetWindowMode()) {
if (WindowHelper::IsValidWindowMode(info->GetWindowMode()) &&
(node->GetWindowMode() != info->GetWindowMode())) {
WLOGFW("set starting window mode. starting mode is: %{public}u, window mode is:%{public}u.",
node->GetWindowMode(), info->GetWindowMode());
node->SetWindowMode(info->GetWindowMode());