diff --git a/window_scene/session/host/src/session.cpp b/window_scene/session/host/src/session.cpp index b80ead6e7d1c35109e8b82feadc2cbd45457c991..12f508082061074ab206517bd37ec8f19d0eace1 100644 --- a/window_scene/session/host/src/session.cpp +++ b/window_scene/session/host/src/session.cpp @@ -1775,7 +1775,9 @@ void Session::SetAttachState(bool isAttach, WindowMode windowMode) TLOGND(WmsLogTag::WMS_LIFE, "session is null"); return; } - if (session->sessionStage_ && WindowHelper::IsNeedWaitAttachStateWindow(session->GetWindowType())) { + auto mainSession = session->GetMainSession(); + if ((!mainSession || !mainSession->GetShowRecent()) && + session->sessionStage_ && WindowHelper::IsNeedWaitAttachStateWindow(session->GetWindowType())) { TLOGNI(WmsLogTag::WMS_LIFE, "NotifyWindowAttachStateChange, persistentId:%{public}d", session->GetPersistentId()); session->sessionStage_->NotifyWindowAttachStateChange(isAttach);