From 0a375e5a95d2440e5c68fa85200c5f7c30a87775 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Sat, 30 May 2020 06:58:47 +0000 Subject: [PATCH] Bug 1641996. Put the focus point of pinch events from Direct Manipulation in widget relative coordinates. r=kats Differential Revision: https://phabricator.services.mozilla.com/D77576 --- widget/windows/DirectManipulationOwner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/windows/DirectManipulationOwner.cpp b/widget/windows/DirectManipulationOwner.cpp index d054c5e7f9db..53a0dfc2ec53 100644 --- a/widget/windows/DirectManipulationOwner.cpp +++ b/widget/windows/DirectManipulationOwner.cpp @@ -383,6 +383,8 @@ void DManipEventHandler::SendPinch(Phase aPhase, float aScale) { POINT cursor_pos; ::GetCursorPos(&cursor_pos); + HWND wnd = static_cast(mWindow ? mWindow->GetNativeData(NS_NATIVE_WINDOW)); + ::ScreenToClient(wnd, &cursor_pos); ScreenPoint position = {(float)cursor_pos.x, (float)cursor_pos.y}; PinchGestureInput event{ @@ -441,6 +443,8 @@ void DManipEventHandler::SendPan(Phase aPhase, float x, float y, POINT cursor_pos; ::GetCursorPos(&cursor_pos); + HWND wnd = static_cast(mWindow ? mWindow->GetNativeData(NS_NATIVE_WINDOW)); + ::ScreenToClient(wnd, &cursor_pos); ScreenPoint position = {(float)cursor_pos.x, (float)cursor_pos.y}; PanGestureInput event{panGestureType, eventIntervalTime, eventTimeStamp,