!10916 修复:startMoving 接口相关判断

Merge pull request !10916 from tanchenghao/moveFix
This commit is contained in:
openharmony_ci 2024-11-22 06:50:35 +00:00 committed by Gitee
commit 2d2cd0ad3f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 17 additions and 7 deletions

View File

@ -2327,8 +2327,10 @@ WSError SceneSession::TransferPointerEventInner(const std::shared_ptr<MMI::Point
return WSError::WS_OK;
}
}
if ((IsDecorEnable() || isMovableSystemWindow) && moveDragController_->
ConsumeMoveEvent(pointerEvent, winRect_)) {
if ((WindowHelper::IsMainWindow(windowType) ||
WindowHelper::IsSubWindow(windowType) ||
WindowHelper::IsSystemWindow(windowType)) &&
moveDragController_->ConsumeMoveEvent(pointerEvent, winRect_)) {
PresentFoucusIfNeed(pointerEvent->GetPointerAction());
pointerEvent->MarkProcessed();
return WSError::WS_OK;

View File

@ -350,6 +350,10 @@ HWTEST_F(SceneSessionTest5, TransferPointerEvent01, Function | SmallTest | Level
pointerEvent->SetPointerAction(2);
EXPECT_EQ(WSError::WS_OK, session->TransferPointerEvent(pointerEvent, false));
session->property_->SetWindowType(WindowType::APP_SUB_WINDOW_BASE);
session->property_->SetDecorEnable(false);
EXPECT_EQ(WSError::WS_OK, session->TransferPointerEvent(pointerEvent, false));
pointerEvent->SetPointerAction(5);
session->property_->SetDragEnabled(true);
systemConfig.windowUIType_ = WindowUIType::PHONE_WINDOW;

View File

@ -752,11 +752,7 @@ bool WindowSceneSessionImpl::HandlePointDownEvent(const std::shared_ptr<MMI::Poi
TLOGD(WmsLogTag::WMS_EVENT, "isFixedSystemWin %{public}d, isFixedSubWin %{public}d, isDecorDialog %{public}d",
isFixedSystemWin, isFixedSubWin, isDecorDialog);
if ((isFixedSystemWin || isFixedSubWin) && !isDecorDialog) {
if (!isFixedSubWin && windowType != WindowType::WINDOW_TYPE_DIALOG) {
hostSession->SendPointEventForMoveDrag(pointerEvent);
} else {
hostSession->ProcessPointDownSession(pointerItem.GetDisplayX(), pointerItem.GetDisplayY());
}
hostSession->SendPointEventForMoveDrag(pointerEvent);
} else {
if (dragType != AreaType::UNDEFINED) {
hostSession->SendPointEventForMoveDrag(pointerEvent);

View File

@ -328,6 +328,14 @@ HWTEST_F(WindowSceneSessionImplTest4, HandlePointDownEvent, Function | SmallTest
pointerItem.SetWindowX(1);
ret = windowSceneSessionImpl->HandlePointDownEvent(pointerEvent, pointerItem, sourceType, vpr, rect);
EXPECT_EQ(true, ret);
windowSceneSessionImpl->property_->SetDragEnabled(true);
ret = windowSceneSessionImpl->HandlePointDownEvent(pointerEvent, pointerItem, sourceType, vpr, rect);
EXPECT_EQ(false, ret);
pointerItem.SetWindowX(100);
ret = windowSceneSessionImpl->HandlePointDownEvent(pointerEvent, pointerItem, sourceType, vpr, rect);
EXPECT_EQ(true, ret);
}
/**