From 955b24acc476b683aa14da00fb3cb2c54f4ffc0d Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Fri, 29 Aug 2025 15:35:37 +0800 Subject: [PATCH 1/6] add log Signed-off-by: jjxxx123 <1720356274@qq.com> --- wmserver/src/input_window_monitor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wmserver/src/input_window_monitor.cpp b/wmserver/src/input_window_monitor.cpp index 42c1d5acd2..82137396c1 100644 --- a/wmserver/src/input_window_monitor.cpp +++ b/wmserver/src/input_window_monitor.cpp @@ -230,6 +230,9 @@ void InputWindowMonitor::TraverseWindowNodes(const std::vector> .agentWindowId = static_cast(windowNode->GetWindowId()), }; + WLOGFD("TraverseWindowNodes,id:%{public}d,pid:%{public}d,uid:%{public}d", + windowInfo.id, windowInfo.pid, windowInfo.uid); + auto iter = (windowNode->GetParentId() == INVALID_WINDOW_ID) ? dialogWindowMap.find(windowNode->GetWindowId()) : dialogWindowMap.find(windowNode->GetParentId()); if (iter != dialogWindowMap.end()) { -- Gitee From 50e6b8f17ac502166f1429cec7ce28554a101e05 Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Thu, 4 Sep 2025 21:34:04 +0800 Subject: [PATCH 2/6] touchoutside except SCBGestureNavBar Signed-off-by: jjxxx123 <1720356274@qq.com> --- .../session/host/src/scene_session.cpp | 6 +++-- .../test/unittest/scene_session_test2.cpp | 4 ++++ .../test/unittest/scene_session_test5.cpp | 23 +++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/window_scene/session/host/src/scene_session.cpp b/window_scene/session/host/src/scene_session.cpp index 677b8ce7c1..fc414ff043 100644 --- a/window_scene/session/host/src/scene_session.cpp +++ b/window_scene/session/host/src/scene_session.cpp @@ -3048,7 +3048,8 @@ WSError SceneSession::ProcessPointDownSession(int32_t posX, int32_t posY) // notify touch outside if (specificCallback_ != nullptr && specificCallback_->onSessionTouchOutside_ && - sessionInfo_.bundleName_.find("SCBGestureBack") == std::string::npos) { + sessionInfo_.bundleName_.find("SCBGestureBack") == std::string::npos && + sessionInfo_.bundleName_.find("SCBGestureNavBar") == std::string::npos) { specificCallback_->onSessionTouchOutside_(id, GetDisplayId()); } @@ -3097,7 +3098,8 @@ void SceneSession::NotifyOutsideDownEvent(const std::shared_ptronSessionTouchOutside_ && - sessionInfo_.bundleName_.find("SCBGestureBack") == std::string::npos) { + sessionInfo_.bundleName_.find("SCBGestureBack") == std::string::npos && + sessionInfo_.bundleName_.find("SCBGestureNavBar") == std::string::npos) { specificCallback_->onSessionTouchOutside_(GetPersistentId(), GetDisplayId()); } diff --git a/window_scene/test/unittest/scene_session_test2.cpp b/window_scene/test/unittest/scene_session_test2.cpp index 4044cac88d..fb73798edf 100644 --- a/window_scene/test/unittest/scene_session_test2.cpp +++ b/window_scene/test/unittest/scene_session_test2.cpp @@ -944,6 +944,10 @@ HWTEST_F(SceneSessionTest2, ProcessPointDownSession, TestSize.Level1) sceneSession->specificCallback_->onOutsideDownEvent_ = nullptr; EXPECT_EQ(WSError::WS_OK, sceneSession->ProcessPointDownSession(3, 4)); + sceneSession->sessionInfo_.bundleName_ = "SCBGestureNavBar"; + sceneSession->specificCallback_->onOutsideDownEvent_ = nullptr; + EXPECT_EQ(WSError::WS_OK, sceneSession->ProcessPointDownSession(3, 4)); + info.windowInputType_ = static_cast(MMI::WindowInputType::TRANSMIT_ALL); sptr sceneSession1 = sptr::MakeSptr(info, nullptr); sceneSession1->specificCallback_ = sptr::MakeSptr(); diff --git a/window_scene/test/unittest/scene_session_test5.cpp b/window_scene/test/unittest/scene_session_test5.cpp index 1faf56afac..2510623280 100644 --- a/window_scene/test/unittest/scene_session_test5.cpp +++ b/window_scene/test/unittest/scene_session_test5.cpp @@ -256,13 +256,32 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) sptr specificCallback = sptr::MakeSptr(); session->specificCallback_ = specificCallback; + int resultValue = 0; + session->specificCallback_->onSessionTouchOutside_ = nullptr; + session->NotifyOutsideDownEvent(pointerEvent); + EXPECT_EQ(0, resultValue); + auto sessionTouchOutsideFun = [&resultValue](int32_t persistentId, DisplayId displayId) { + resultValue = 1; + return; + }; + session->sessionInfo_.bundleName_ = "SCBGestureBack"; + session->NotifyOutsideDownEvent(pointerEvent); + EXPECT_EQ(0, resultValue); + session->sessionInfo_.bundleName_ = "SCBGestureNavBar"; + session->NotifyOutsideDownEvent(pointerEvent); + EXPECT_EQ(0, resultValue); + session->sessionInfo_.bundleName_ = "NotifyOutsideDownEvent"; session->specificCallback_->onOutsideDownEvent_ = nullptr; session->NotifyOutsideDownEvent(pointerEvent); - OnOutsideDownEvent func = [](int32_t x, int32_t y) { return; }; + EXPECT_EQ(1, resultValue); + OnOutsideDownEvent func = [](int32_t x, int32_t y) { + resultValue = 2; + return; + }; session->specificCallback_->onOutsideDownEvent_ = func; session->NotifyOutsideDownEvent(pointerEvent); auto res = pointerEvent->GetPointerItem(2024, pointerItem); - EXPECT_EQ(true, res); + EXPECT_EQ(2, resultValue); pointerEvent->SetPointerAction(5); session->NotifyOutsideDownEvent(pointerEvent); -- Gitee From 9c3e4aae5936724af883c047424523333c2d1429 Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Thu, 4 Sep 2025 21:40:48 +0800 Subject: [PATCH 3/6] delete log Signed-off-by: jjxxx123 <1720356274@qq.com> --- wmserver/src/input_window_monitor.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/wmserver/src/input_window_monitor.cpp b/wmserver/src/input_window_monitor.cpp index 82137396c1..42c1d5acd2 100644 --- a/wmserver/src/input_window_monitor.cpp +++ b/wmserver/src/input_window_monitor.cpp @@ -230,9 +230,6 @@ void InputWindowMonitor::TraverseWindowNodes(const std::vector> .agentWindowId = static_cast(windowNode->GetWindowId()), }; - WLOGFD("TraverseWindowNodes,id:%{public}d,pid:%{public}d,uid:%{public}d", - windowInfo.id, windowInfo.pid, windowInfo.uid); - auto iter = (windowNode->GetParentId() == INVALID_WINDOW_ID) ? dialogWindowMap.find(windowNode->GetWindowId()) : dialogWindowMap.find(windowNode->GetParentId()); if (iter != dialogWindowMap.end()) { -- Gitee From 9462e08ac87da4be2724239e4e62f3d6603d57fb Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Thu, 4 Sep 2025 22:38:18 +0800 Subject: [PATCH 4/6] touchoutside except SCBGestureNavBar Signed-off-by: jjxxx123 <1720356274@qq.com> --- .../test/unittest/scene_session_test5.cpp | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/window_scene/test/unittest/scene_session_test5.cpp b/window_scene/test/unittest/scene_session_test5.cpp index 2510623280..3e2efa1084 100644 --- a/window_scene/test/unittest/scene_session_test5.cpp +++ b/window_scene/test/unittest/scene_session_test5.cpp @@ -256,41 +256,74 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) sptr specificCallback = sptr::MakeSptr(); session->specificCallback_ = specificCallback; - int resultValue = 0; + int resultValue1 = 0; + int resultValue2 = 0; session->specificCallback_->onSessionTouchOutside_ = nullptr; + OnOutsideDownEvent func = [&resultValue1](int32_t x, int32_t y) { + resultValue1 += 1; + return; + }; + session->specificCallback_->onOutsideDownEvent_ = nullptr; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue); - auto sessionTouchOutsideFun = [&resultValue](int32_t persistentId, DisplayId displayId) { - resultValue = 1; + EXPECT_EQ(0, resultValue1); + auto sessionTouchOutsideFun = [&resultValue2](int32_t persistentId, DisplayId displayId) { + resultValue2 += 1; return; }; session->sessionInfo_.bundleName_ = "SCBGestureBack"; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue); + EXPECT_EQ(0, resultValue2); session->sessionInfo_.bundleName_ = "SCBGestureNavBar"; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue); + EXPECT_EQ(0, resultValue2); session->sessionInfo_.bundleName_ = "NotifyOutsideDownEvent"; - session->specificCallback_->onOutsideDownEvent_ = nullptr; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(1, resultValue); - OnOutsideDownEvent func = [](int32_t x, int32_t y) { - resultValue = 2; - return; + EXPECT_EQ(1, resultValue2); +} + +/** + * @tc.name: NotifyOutsideDownEvent1 + * @tc.desc: NotifyOutsideDownEvent1 function + * @tc.type: FUNC + */ + HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent1, TestSize.Level1) + { + SessionInfo info; + info.abilityName_ = "NotifyOutsideDownEvent"; + info.bundleName_ = "NotifyOutsideDownEvent"; + info.windowInputType_ = static_cast(MMI::WindowInputType::NORMAL); + + sptr session = sptr::MakeSptr(info, nullptr); + EXPECT_NE(session, nullptr); + std::shared_ptr pointerEvent = MMI::PointerEvent::Create(); + pointerEvent->SetPointerAction(2); + MMI::PointerEvent::PointerItem pointerItem; + pointerItem.SetPointerId(2024); + pointerEvent->AddPointerItem(pointerItem); + pointerEvent->SetPointerId(2024); + sptr specificCallback = + sptr::MakeSptr(); + session->specificCallback_ = specificCallback; + int resultValue = 0; + OnOutsideDownEvent func = [&resultValue](int32_t x, int32_t y) { + resultValue += 1; + return; }; session->specificCallback_->onOutsideDownEvent_ = func; session->NotifyOutsideDownEvent(pointerEvent); auto res = pointerEvent->GetPointerItem(2024, pointerItem); - EXPECT_EQ(2, resultValue); + EXPECT_EQ(1, resultValue); pointerEvent->SetPointerAction(5); session->NotifyOutsideDownEvent(pointerEvent); pointerEvent->RemoveAllPointerItems(); + EXPECT_EQ(1, resultValue); info.windowInputType_ = static_cast(MMI::WindowInputType::TRANSMIT_ALL); sptr session1 = sptr::MakeSptr(info, nullptr); session1->NotifyOutsideDownEvent(pointerEvent); -} + EXPECT_EQ(1, resultValue); + } /** * @tc.name: TransferPointerEventInnerTest -- Gitee From 6f489a5653003dda6b343d9d7a735dccfc15270f Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Fri, 5 Sep 2025 09:40:35 +0800 Subject: [PATCH 5/6] touchoutside except SCBGestureNavBar Signed-off-by: jjxxx123 <1720356274@qq.com> --- window_scene/test/unittest/scene_session_test5.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/window_scene/test/unittest/scene_session_test5.cpp b/window_scene/test/unittest/scene_session_test5.cpp index 3e2efa1084..747a3d546f 100644 --- a/window_scene/test/unittest/scene_session_test5.cpp +++ b/window_scene/test/unittest/scene_session_test5.cpp @@ -270,14 +270,13 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) resultValue2 += 1; return; }; + session->NotifyOutsideDownEvent(pointerEvent); + EXPECT_EQ(1, resultValue2); session->sessionInfo_.bundleName_ = "SCBGestureBack"; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue2); + EXPECT_EQ(1, resultValue2); session->sessionInfo_.bundleName_ = "SCBGestureNavBar"; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue2); - session->sessionInfo_.bundleName_ = "NotifyOutsideDownEvent"; - session->NotifyOutsideDownEvent(pointerEvent); EXPECT_EQ(1, resultValue2); } @@ -286,8 +285,8 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) * @tc.desc: NotifyOutsideDownEvent1 function * @tc.type: FUNC */ - HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent1, TestSize.Level1) - { +HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent1, TestSize.Level1) +{ SessionInfo info; info.abilityName_ = "NotifyOutsideDownEvent"; info.bundleName_ = "NotifyOutsideDownEvent"; @@ -323,7 +322,7 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) sptr session1 = sptr::MakeSptr(info, nullptr); session1->NotifyOutsideDownEvent(pointerEvent); EXPECT_EQ(1, resultValue); - } +} /** * @tc.name: TransferPointerEventInnerTest -- Gitee From 27134ca2f94e2a32aae93df1e4d62a5f979030da Mon Sep 17 00:00:00 2001 From: jjxxx123 <1720356274@qq.com> Date: Fri, 5 Sep 2025 11:08:26 +0800 Subject: [PATCH 6/6] touchoutside except SCBGestureNavBar Signed-off-by: jjxxx123 <1720356274@qq.com> --- window_scene/test/unittest/scene_session_test5.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/window_scene/test/unittest/scene_session_test5.cpp b/window_scene/test/unittest/scene_session_test5.cpp index 747a3d546f..48c3883ca2 100644 --- a/window_scene/test/unittest/scene_session_test5.cpp +++ b/window_scene/test/unittest/scene_session_test5.cpp @@ -263,9 +263,11 @@ HWTEST_F(SceneSessionTest5, NotifyOutsideDownEvent, TestSize.Level1) resultValue1 += 1; return; }; + session->NotifyOutsideDownEvent(pointerEvent); + EXPECT_EQ(1, resultValue1); session->specificCallback_->onOutsideDownEvent_ = nullptr; session->NotifyOutsideDownEvent(pointerEvent); - EXPECT_EQ(0, resultValue1); + EXPECT_EQ(1, resultValue1); auto sessionTouchOutsideFun = [&resultValue2](int32_t persistentId, DisplayId displayId) { resultValue2 += 1; return; -- Gitee