create window bugfix

Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
Change-Id: Ie606d71e8196e70f662d2e41a92c42585abddc50
Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
This commit is contained in:
chyyy0213
2022-05-11 16:36:36 +08:00
parent b3674caa8a
commit 3f2aad8fcf
+7 -3
View File
@@ -53,8 +53,8 @@ bool WindowController::IsWindowNeedMinimizedByOther(const sptr<WindowNode>& targ
void WindowController::StartingWindow(sptr<WindowTransitionInfo> info, sptr<Media::PixelMap> pixelMap,
uint32_t bkgColor, bool isColdStart)
{
if (info->GetAbilityToken() == nullptr || info->GetBundleName().find("permission") != std::string::npos) {
WLOGFE("AbilityToken is nullptr!");
if (!info || info->GetAbilityToken() == nullptr || info->GetBundleName().find("permission") != std::string::npos) {
WLOGFE("info or AbilityToken is nullptr!");
return;
}
auto node = windowRoot_->FindWindowNodeWithToken(info->GetAbilityToken());
@@ -98,6 +98,10 @@ void WindowController::CancelStartingWindow(sptr<IRemoteObject> abilityToken)
WMError WindowController::NotifyWindowTransition(sptr<WindowTransitionInfo>& srcInfo,
sptr<WindowTransitionInfo>& dstInfo)
{
if (!srcInfo || !dstInfo) {
WLOGFE("srcInfo or dstInfo is nullptr!");
return WMError::WM_ERROR_NULLPTR;
}
auto dstNode = windowRoot_->FindWindowNodeWithToken(dstInfo->GetAbilityToken());
auto srcNode = windowRoot_->FindWindowNodeWithToken(srcInfo->GetAbilityToken());
if (!RemoteAnimation::CheckTransition(srcInfo, srcNode, dstInfo, dstNode)) {
@@ -148,7 +152,7 @@ WMError WindowController::CreateWindow(sptr<IWindow>& window, sptr<WindowPropert
return WMError::WM_ERROR_INVALID_TYPE;
}
sptr<WindowNode> node = windowRoot_->FindWindowNodeWithToken(token);
if (node != nullptr && WindowHelper::IsMainWindow(node->GetWindowType()) &&
if (node != nullptr && WindowHelper::IsMainWindow(property->GetWindowType()) &&
property->GetWindowName().find("permission") == std::string::npos && node->startingWindowShown_) {
StartingWindow::HandleClientWindowCreate(node, window, windowId, surfaceNode);
windowRoot_->AddDeathRecipient(node);