mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-03-01 12:16:23 +00:00
意见修改
Signed-off-by: 万孝国 <wanxiaoguo@huawei.com>
This commit is contained in:
parent
a9fbe8ba96
commit
54227ea808
@ -1684,7 +1684,7 @@ sptr<Session> Session::GetParentSession() const
|
||||
sptr<Session> Session::GetMainSession() const
|
||||
{
|
||||
if (SessionHelper::IsMainWindow(GetWindowType())) {
|
||||
return const_cast<Session *>(this);
|
||||
return const_cast<Session*>(this);
|
||||
} else if (parentSession_) {
|
||||
return parentSession_->GetMainSession();
|
||||
} else {
|
||||
|
@ -4140,13 +4140,15 @@ bool SceneSessionManager::IsSessionVisible(const sptr<SceneSession>& session)
|
||||
if (WindowHelper::IsSubWindow(session->GetWindowType())) {
|
||||
const auto& mainSession = session->GetMainSession();
|
||||
if (mainSession == nullptr) {
|
||||
TLOGE(WmsLogTag::WMS_SUB, "Can not find parent for this sub window, id: %{public}d", session->GetPersistentId());
|
||||
TLOGE(WmsLogTag::WMS_SUB, "Can not find parent for this sub window, id: %{public}d",
|
||||
session->GetPersistentId());
|
||||
return false;
|
||||
}
|
||||
const auto& mainState = mainSession->GetSessionState();
|
||||
const auto mainState = mainSession->GetSessionState();
|
||||
if (session->IsVisible() || (state == SessionState::STATE_ACTIVE || state == SessionState::STATE_FOREGROUND)) {
|
||||
if (mainState == SessionState::STATE_INACTIVE || mainState == SessionState::STATE_BACKGROUND) {
|
||||
TLOGD(WmsLogTag::WMS_SUB, "Parent of this sub window is at background, id: %{public}d", session->GetPersistentId());
|
||||
TLOGD(WmsLogTag::WMS_SUB, "Parent of this sub window is at background, id: %{public}d",
|
||||
session->GetPersistentId());
|
||||
return false;
|
||||
}
|
||||
TLOGD(WmsLogTag::WMS_SUB, "Sub window is at foreground, id: %{public}d", session->GetPersistentId());
|
||||
|
Loading…
x
Reference in New Issue
Block a user