From 00cfde8ba3c5fb6196d0446344cee9753d25387c Mon Sep 17 00:00:00 2001 From: duanwenhao Date: Wed, 20 Jul 2022 06:30:02 +0000 Subject: [PATCH] Modify screenX and screenY Signed-off-by: duanwenhao --- .../src/input_windows_manager.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/service/window_manager/src/input_windows_manager.cpp b/service/window_manager/src/input_windows_manager.cpp index 6d493052ef..d2e2d82b3b 100755 --- a/service/window_manager/src/input_windows_manager.cpp +++ b/service/window_manager/src/input_windows_manager.cpp @@ -471,19 +471,19 @@ int32_t InputWindowsManager::UpdateMouseTarget(std::shared_ptr poi } pointerEvent->SetTargetWindowId(touchWindow->id); pointerEvent->SetAgentWindowId(touchWindow->agentWindowId); - int32_t screenX = logicalX - touchWindow->area.x; - int32_t screenY = logicalY - touchWindow->area.y; - pointerItem.SetWindowX(screenX); - pointerItem.SetWindowY(screenY); + int32_t windowX = logicalX - touchWindow->area.x; + int32_t windowY = logicalY - touchWindow->area.y; + pointerItem.SetWindowX(windowX); + pointerItem.SetWindowY(windowY); pointerEvent->UpdatePointerItem(pointerId, pointerItem); CHKPR(udsServer_, ERROR_NULL_POINTER); auto fd = udsServer_->GetClientFd(touchWindow->pid); MMI_HILOGD("fd:%{public}d,pid:%{public}d,id:%{public}d,agentWindowId:%{public}d," "logicalX:%{public}d,logicalY:%{public}d," - "displayX:%{public}d,displayY:%{public}d,screenX:%{public}d,screenY:%{public}d", + "displayX:%{public}d,displayY:%{public}d,windowX:%{public}d,windowY:%{public}d", fd, touchWindow->pid, touchWindow->id, touchWindow->agentWindowId, - logicalX, logicalY, pointerItem.GetDisplayX(), pointerItem.GetDisplayY(), screenX, screenY); + logicalX, logicalY, pointerItem.GetDisplayX(), pointerItem.GetDisplayY(), windowX, windowY); return fd; } #endif // OHOS_BUILD_ENABLE_POINTER @@ -544,24 +544,24 @@ int32_t InputWindowsManager::UpdateTouchScreenTarget(std::shared_ptrarea.x; - auto screenY = logicalY - touchWindow->area.y; + auto windowX = logicalX - touchWindow->area.x; + auto windowY = logicalY - touchWindow->area.y; pointerEvent->SetTargetWindowId(touchWindow->id); pointerEvent->SetAgentWindowId(touchWindow->agentWindowId); pointerItem.SetDisplayX(physicalX); pointerItem.SetDisplayY(physicalY); - pointerItem.SetWindowX(screenX); - pointerItem.SetWindowY(screenY); + pointerItem.SetWindowX(windowX); + pointerItem.SetWindowY(windowY); pointerItem.SetToolWindowX(pointerItem.GetToolDisplayX() + physicDisplayInfo->x - touchWindow->area.x); pointerItem.SetToolWindowY(pointerItem.GetToolDisplayY() + physicDisplayInfo->y - touchWindow->area.y); pointerItem.SetTargetWindowId(touchWindow->id); pointerEvent->UpdatePointerItem(pointerId, pointerItem); auto fd = udsServer_->GetClientFd(touchWindow->pid); MMI_HILOGD("pid:%{public}d,fd:%{public}d,logicalX:%{public}d,logicalY:%{public}d," - "physicalX:%{public}d,physicalY:%{public}d,screenX:%{public}d,screenY:%{public}d," + "physicalX:%{public}d,physicalY:%{public}d,windowX:%{public}d,windowY:%{public}d," "displayId:%{public}d,TargetWindowId:%{public}d,AgentWindowId:%{public}d", touchWindow->pid, fd, logicalX, logicalY, physicalX, physicalY, - screenX, screenY, displayId, pointerEvent->GetTargetWindowId(), pointerEvent->GetAgentWindowId()); + windowX, windowY, displayId, pointerEvent->GetTargetWindowId(), pointerEvent->GetAgentWindowId()); return fd; } #endif // OHOS_BUILD_ENABLE_TOUCH -- Gitee