diff --git a/window_scene/session/host/include/scene_session.h b/window_scene/session/host/include/scene_session.h index 2880ded60d846aa919325f816d347b0a6084a2f9..0d613407a0872f60a4cdc216cf97944beb02ca4e 100644 --- a/window_scene/session/host/include/scene_session.h +++ b/window_scene/session/host/include/scene_session.h @@ -523,6 +523,7 @@ public: bool IsDecorEnable() const; bool IsAppSession() const; bool IsAppOrLowerSystemSession() const; + bool IsFullScreenSystemPanel() const; bool IsSystemSessionAboveApp() const; bool IsTurnScreenOn() const; bool IsKeepScreenOn() const; diff --git a/window_scene/session/host/src/scene_session.cpp b/window_scene/session/host/src/scene_session.cpp index 02787dc383b402ef3970d64313b35da230778be9..b5708ce15fd3d42f2881ba6496d88c65101f0d49 100644 --- a/window_scene/session/host/src/scene_session.cpp +++ b/window_scene/session/host/src/scene_session.cpp @@ -4970,6 +4970,22 @@ bool SceneSession::IsAppOrLowerSystemSession() const return IsAppSession(); } +/** @note @window.focus */ +bool SceneSession::IsFullScreenSystemPanel() const +{ + WindowType windowType = GetWindowType(); + if (windowType == WindowType::WINDOW_TYPE_PANEL && + (systemConfig_.IsPhoneWindow() || systemConfig_.IsPadWindow()) && + sessionInfo_.bundleName_.find("SCBDropdownPanel") != std::string::npos) { + return true; + } + if (windowType == WindowType::WINDOW_TYPE_GLOBAL_SEARCH || + windowType == WindowType::WINDOW_TYPE_NEGATIVE_SCREEN) { + return true; + } + return false; +} + /** @note @window.focus */ bool SceneSession::IsSystemSessionAboveApp() const { diff --git a/window_scene/session_manager/src/scene_session_manager.cpp b/window_scene/session_manager/src/scene_session_manager.cpp index dcfb44388f701d5dd3dc59b28db79af34b06f0f3..6d9dbaa1f593df854e856d4cde198b564a4a0e84 100644 --- a/window_scene/session_manager/src/scene_session_manager.cpp +++ b/window_scene/session_manager/src/scene_session_manager.cpp @@ -7667,8 +7667,7 @@ bool SceneSessionManager::CheckRequestFocusSubWindowImmediately(const sptr& focusedSession, const sptr& sceneSession, FocusChangeReason reason) { - if (focusedSession->GetWindowType() != WindowType::WINDOW_TYPE_GLOBAL_SEARCH && - focusedSession->GetWindowType() != WindowType::WINDOW_TYPE_NEGATIVE_SCREEN) { + if (!focusedSession->IsFullScreenSystemPanel()) { return false; } if (reason != FocusChangeReason::CLICK || !focusedSession->GetBlockingFocus()) { diff --git a/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp b/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp index 22ef170514a25f14f29833f0582c347a8e08e352..e3fea67971c76a181415c088466dd81ebc75a6ce 100644 --- a/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp +++ b/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp @@ -143,6 +143,50 @@ HWTEST_F(WindowFocusSceneSessionTest, IsAppOrLowerSystemSession02, TestSize.Leve ASSERT_EQ(true, sceneSession->IsAppOrLowerSystemSession()); } +/** + * @tc.name: IsFullScreenSystemPanel + * @tc.desc: IsFullScreenSystemPanel + * @tc.type: FUNC + */ +HWTEST_F(WindowFocusSceneSessionTest, IsFullScreenSystemPanel, TestSize.Level1) +{ + SessionInfo info1; + info1.abilityName_ = "IsFullScreenSystemPanel01"; + info1.bundleName_ = "IsFullScreenSystemPanel01"; + info1.windowType_ = 2125; + + sptr sceneSession1 = sptr::MakeSptr(info1, nullptr); + EXPECT_EQ(true, sceneSession1->IsFullScreenSystemPanel()); + + SessionInfo info2; + info2.abilityName_ = "IsFullScreenSystemPanel02"; + info2.bundleName_ = "IsFullScreenSystemPanel02"; + info2.windowType_ = 2126; + + sptr sceneSession2 = sptr::MakeSptr(info2, nullptr); + EXPECT_EQ(true, sceneSession2->IsFullScreenSystemPanel()); + + SessionInfo info3; + info3.abilityName_ = "IsFullScreenSystemPanel03"; + info3.bundleName_ = "SCBDropdownPanel"; + info3.windowType_ = 2109; + + sptr sceneSession3 = sptr::MakeSptr(info3, nullptr); + sceneSession3->systemConfig_.windowUIType_ = WindowUIType::PHONE_WINDOW; + EXPECT_EQ(true, sceneSession3->IsFullScreenSystemPanel()); + + sceneSession3->systemConfig_.windowUIType_ = WindowUIType::PAD_WINDOW; + EXPECT_EQ(true, sceneSession3->IsFullScreenSystemPanel()); + + SessionInfo info4; + info4.abilityName_ = "IsFullScreenSystemPanel04"; + info4.bundleName_ = "IsFullScreenSystemPanel04"; + info4.windowType_ = 1001; + + sptr sceneSession4 = sptr::MakeSptr(info4, nullptr); + EXPECT_EQ(false, sceneSession4->IsFullScreenSystemPanel()); +} + /** * @tc.name: IsSystemSessionAboveApp * @tc.desc: IsSystemSessionAboveApp true