Skip to content

Commit 1571fe3

Browse files
committed
Bug 896251 - Make nsEvent::{refPoint, lastRefPoint} LayoutDeviceIntPoints; r=smaug+kats
1 parent ee0442e commit 1571fe3

35 files changed

+202
-166
lines changed

accessible/src/base/nsCoreUtils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include "nsITreeBoxObject.h"
4242
#include "nsITreeColumns.h"
4343

44+
using namespace mozilla;
45+
4446
////////////////////////////////////////////////////////////////////////////////
4547
// nsCoreUtils
4648
////////////////////////////////////////////////////////////////////////////////
@@ -130,7 +132,7 @@ nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
130132
nsMouseEvent event(true, aEventType, aRootWidget,
131133
nsMouseEvent::eReal, nsMouseEvent::eNormal);
132134

133-
event.refPoint = nsIntPoint(aX, aY);
135+
event.refPoint = LayoutDeviceIntPoint(aX, aY);
134136

135137
event.clickCount = 1;
136138
event.button = nsMouseEvent::eLeftButton;

accessible/src/generic/Accessible.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY,
840840

841841
nsMouseEvent dummyEvent(true, NS_MOUSE_MOVE, rootWidget,
842842
nsMouseEvent::eSynthesized);
843-
dummyEvent.refPoint = nsIntPoint(aX - rootRect.x, aY - rootRect.y);
843+
dummyEvent.refPoint = LayoutDeviceIntPoint(aX - rootRect.x, aY - rootRect.y);
844844

845845
nsIFrame* popupFrame = nsLayoutUtils::
846846
GetPopupFrameForEventCoordinates(accDocument->PresContext()->GetRootPresContext(),

content/events/src/Touch.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,14 @@ Touch::InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent)
134134
if (mPointsInitialized) {
135135
return;
136136
}
137-
mClientPoint = nsDOMEvent::GetClientCoords(aPresContext,
138-
aEvent,
139-
mRefPoint,
140-
mClientPoint);
141-
mPagePoint = nsDOMEvent::GetPageCoords(aPresContext,
142-
aEvent,
143-
mRefPoint,
144-
mClientPoint);
145-
mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent, mRefPoint);
137+
mClientPoint = nsDOMEvent::GetClientCoords(
138+
aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
139+
mClientPoint);
140+
mPagePoint = nsDOMEvent::GetPageCoords(
141+
aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
142+
mClientPoint);
143+
mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent,
144+
LayoutDeviceIntPoint::FromUntyped(mRefPoint));
146145
mPointsInitialized = true;
147146
}
148147

content/events/src/nsContentEventHandler.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "mozilla/dom/Element.h"
3030
#include <algorithm>
3131

32+
using namespace mozilla;
3233
using namespace mozilla::dom;
3334

3435
/******************************************************************/
@@ -832,8 +833,8 @@ nsContentEventHandler::OnQueryCharacterAtPoint(nsQueryContentEvent* aEvent)
832833
rootWidget);
833834
eventOnRoot.refPoint = aEvent->refPoint;
834835
if (rootWidget != aEvent->widget) {
835-
eventOnRoot.refPoint += aEvent->widget->WidgetToScreenOffset();
836-
eventOnRoot.refPoint -= rootWidget->WidgetToScreenOffset();
836+
eventOnRoot.refPoint += LayoutDeviceIntPoint::FromUntyped(
837+
aEvent->widget->WidgetToScreenOffset() - rootWidget->WidgetToScreenOffset());
837838
}
838839
nsPoint ptInRoot =
839840
nsLayoutUtils::GetEventCoordinatesRelativeTo(&eventOnRoot, rootFrame);
@@ -891,16 +892,15 @@ nsContentEventHandler::OnQueryDOMWidgetHittest(nsQueryContentEvent* aEvent)
891892
nsIFrame* docFrame = mPresShell->GetRootFrame();
892893
NS_ENSURE_TRUE(docFrame, NS_ERROR_FAILURE);
893894

894-
nsIntPoint eventLoc =
895-
aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
895+
LayoutDeviceIntPoint eventLoc = aEvent->refPoint +
896+
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
896897
nsIntRect docFrameRect = docFrame->GetScreenRect(); // Returns CSS pixels
897-
eventLoc.x = mPresContext->DevPixelsToIntCSSPixels(eventLoc.x);
898-
eventLoc.y = mPresContext->DevPixelsToIntCSSPixels(eventLoc.y);
899-
eventLoc.x -= docFrameRect.x;
900-
eventLoc.y -= docFrameRect.y;
898+
CSSIntPoint eventLocCSS(
899+
mPresContext->DevPixelsToIntCSSPixels(eventLoc.x) - docFrameRect.x,
900+
mPresContext->DevPixelsToIntCSSPixels(eventLoc.y) - docFrameRect.y);
901901

902902
Element* contentUnderMouse =
903-
doc->ElementFromPointHelper(eventLoc.x, eventLoc.y, false, false);
903+
doc->ElementFromPointHelper(eventLocCSS.x, eventLocCSS.y, false, false);
904904
if (contentUnderMouse) {
905905
nsIWidget* targetWidget = nullptr;
906906
nsIFrame* targetFrame = contentUnderMouse->GetPrimaryFrame();

content/events/src/nsDOMEvent.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ nsDOMEvent::Shutdown()
10631063
nsIntPoint
10641064
nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
10651065
nsEvent* aEvent,
1066-
nsIntPoint aPoint)
1066+
LayoutDeviceIntPoint aPoint)
10671067
{
10681068
if (nsEventStateManager::sIsPointerLocked) {
10691069
return nsEventStateManager::sLastScreenPoint;
@@ -1081,10 +1081,11 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
10811081

10821082
nsGUIEvent* guiEvent = static_cast<nsGUIEvent*>(aEvent);
10831083
if (!guiEvent->widget) {
1084-
return aPoint;
1084+
return LayoutDeviceIntPoint::ToUntyped(aPoint);
10851085
}
10861086

1087-
nsIntPoint offset = aPoint + guiEvent->widget->WidgetToScreenOffset();
1087+
LayoutDeviceIntPoint offset = aPoint +
1088+
LayoutDeviceIntPoint::FromUntyped(guiEvent->widget->WidgetToScreenOffset());
10881089
nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
10891090
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
10901091
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
@@ -1094,7 +1095,7 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
10941095
CSSIntPoint
10951096
nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
10961097
nsEvent* aEvent,
1097-
nsIntPoint aPoint,
1098+
LayoutDeviceIntPoint aPoint,
10981099
CSSIntPoint aDefaultPoint)
10991100
{
11001101
CSSIntPoint pagePoint = nsDOMEvent::GetClientCoords(aPresContext,
@@ -1118,7 +1119,7 @@ nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
11181119
CSSIntPoint
11191120
nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
11201121
nsEvent* aEvent,
1121-
nsIntPoint aPoint,
1122+
LayoutDeviceIntPoint aPoint,
11221123
CSSIntPoint aDefaultPoint)
11231124
{
11241125
if (nsEventStateManager::sIsPointerLocked) {
@@ -1147,7 +1148,8 @@ nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
11471148
return CSSIntPoint(0, 0);
11481149
}
11491150
nsPoint pt =
1150-
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aPoint, rootFrame);
1151+
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent,
1152+
LayoutDeviceIntPoint::ToUntyped(aPoint), rootFrame);
11511153

11521154
return CSSIntPoint::FromAppUnitsRounded(pt);
11531155
}

content/events/src/nsDOMEvent.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ class nsDOMEvent : public nsDOMEventBase,
102102
static const char* GetEventName(uint32_t aEventType);
103103
static mozilla::CSSIntPoint
104104
GetClientCoords(nsPresContext* aPresContext, nsEvent* aEvent,
105-
nsIntPoint aPoint, mozilla::CSSIntPoint aDefaultPoint);
105+
mozilla::LayoutDeviceIntPoint aPoint,
106+
mozilla::CSSIntPoint aDefaultPoint);
106107
static mozilla::CSSIntPoint
107-
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent, nsIntPoint aPoint,
108+
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent,
109+
mozilla::LayoutDeviceIntPoint aPoint,
108110
mozilla::CSSIntPoint aDefaultPoint);
109-
static nsIntPoint GetScreenCoords(nsPresContext* aPresContext,
110-
nsEvent* aEvent,
111-
nsIntPoint aPoint);
111+
static nsIntPoint
112+
GetScreenCoords(nsPresContext* aPresContext, nsEvent* aEvent,
113+
mozilla::LayoutDeviceIntPoint aPoint);
112114

113115
static already_AddRefed<nsDOMEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
114116
const nsAString& aType,

content/events/src/nsDOMUIEvent.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent)
102102
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
103103

104104
static nsIntPoint
105-
DevPixelsToCSSPixels(const nsIntPoint& aPoint, nsPresContext* aContext)
105+
DevPixelsToCSSPixels(const LayoutDeviceIntPoint& aPoint,
106+
nsPresContext* aContext)
106107
{
107108
return nsIntPoint(aContext->DevPixelsToIntCSSPixels(aPoint.x),
108109
aContext->DevPixelsToIntCSSPixels(aPoint.y));
@@ -375,7 +376,7 @@ nsDOMUIEvent::DuplicatePrivateData()
375376
mEvent->refPoint);
376377
nsresult rv = nsDOMEvent::DuplicatePrivateData();
377378
if (NS_SUCCEEDED(rv)) {
378-
mEvent->refPoint = screenPoint;
379+
mEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(screenPoint);
379380
}
380381
return rv;
381382
}

content/events/src/nsDOMUIEvent.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class nsDOMUIEvent : public nsDOMEvent,
3434
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
3535
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
3636

37-
static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
38-
nsEvent* aEvent)
37+
static nsIntPoint
38+
CalculateScreenPoint(nsPresContext* aPresContext, nsEvent* aEvent)
3939
{
4040
if (!aEvent ||
4141
(aEvent->eventStructType != NS_MOUSE_EVENT &&
@@ -46,12 +46,13 @@ class nsDOMUIEvent : public nsDOMEvent,
4646
return nsIntPoint(0, 0);
4747
}
4848

49-
if (!((nsGUIEvent*)aEvent)->widget ) {
50-
return aEvent->refPoint;
49+
nsGUIEvent* event = static_cast<nsGUIEvent*>(aEvent);
50+
if (!event->widget) {
51+
return mozilla::LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint);
5152
}
5253

53-
nsIntPoint offset = aEvent->refPoint +
54-
((nsGUIEvent*)aEvent)->widget->WidgetToScreenOffset();
54+
mozilla::LayoutDeviceIntPoint offset = aEvent->refPoint +
55+
mozilla::LayoutDeviceIntPoint::FromUntyped(event->widget->WidgetToScreenOffset());
5556
nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
5657
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
5758
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));

content/events/src/nsEventStateManager.cpp

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ using namespace mozilla::dom;
109109

110110
#define NS_USER_INTERACTION_INTERVAL 5000 // ms
111111

112-
static const nsIntPoint kInvalidRefPoint = nsIntPoint(-1,-1);
112+
static const LayoutDeviceIntPoint kInvalidRefPoint = LayoutDeviceIntPoint(-1,-1);
113113

114114
static bool sLeftClickOnly = true;
115115
static bool sKeyCausesActivation = true;
@@ -120,9 +120,9 @@ bool nsEventStateManager::sNormalLMouseEventInProcess = false;
120120
nsEventStateManager* nsEventStateManager::sActiveESM = nullptr;
121121
nsIDocument* nsEventStateManager::sMouseOverDocument = nullptr;
122122
nsWeakFrame nsEventStateManager::sLastDragOverFrame = nullptr;
123-
nsIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint;
124-
nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0,0);
125-
nsIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
123+
LayoutDeviceIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint;
124+
nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0, 0);
125+
LayoutDeviceIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
126126
CSSIntPoint nsEventStateManager::sLastClientPoint = CSSIntPoint(0, 0);
127127
bool nsEventStateManager::sIsPointerLocked = false;
128128
// Reference to the pointer locked element.
@@ -567,7 +567,8 @@ nsMouseWheelTransaction::GetScreenPoint(nsGUIEvent* aEvent)
567567
{
568568
NS_ASSERTION(aEvent, "aEvent is null");
569569
NS_ASSERTION(aEvent->widget, "aEvent-widget is null");
570-
return aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
570+
return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint) +
571+
aEvent->widget->WidgetToScreenOffset();
571572
}
572573

573574
uint32_t
@@ -1547,19 +1548,18 @@ nsEventStateManager::GetChildProcessOffset(nsFrameLoader* aFrameLoader,
15471548
nsEventStateManager::MapEventCoordinatesForChildProcess(
15481549
const LayoutDeviceIntPoint& aOffset, nsEvent* aEvent)
15491550
{
1550-
nsIntPoint aOffsetIntPoint(aOffset.x, aOffset.y);
15511551
if (aEvent->eventStructType != NS_TOUCH_EVENT) {
1552-
aEvent->refPoint = aOffsetIntPoint;
1552+
aEvent->refPoint = aOffset;
15531553
} else {
1554-
aEvent->refPoint = nsIntPoint();
1554+
aEvent->refPoint = LayoutDeviceIntPoint();
15551555
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
15561556
// Then offset all the touch points by that distance, to put them
15571557
// in the space where top-left is 0,0.
15581558
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
15591559
for (uint32_t i = 0; i < touches.Length(); ++i) {
15601560
nsIDOMTouch* touch = touches[i];
15611561
if (touch) {
1562-
touch->mRefPoint += aOffsetIntPoint;
1562+
touch->mRefPoint += LayoutDeviceIntPoint::ToUntyped(aOffset);
15631563
}
15641564
}
15651565
}
@@ -1921,7 +1921,7 @@ nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext,
19211921
// Note that |inDownEvent| could be either a mouse down event or a
19221922
// synthesized mouse move event.
19231923
mGestureDownPoint = inDownEvent->refPoint +
1924-
inDownEvent->widget->WidgetToScreenOffset();
1924+
LayoutDeviceIntPoint::FromUntyped(inDownEvent->widget->WidgetToScreenOffset());
19251925

19261926
inDownFrame->GetContentForEvent(inDownEvent,
19271927
getter_AddRefs(mGestureDownContent));
@@ -1959,8 +1959,8 @@ nsEventStateManager::FillInEventFromGestureDown(nsMouseEvent* aEvent)
19591959
// Set the coordinates in the new event to the coordinates of
19601960
// the old event, adjusted for the fact that the widget might be
19611961
// different
1962-
nsIntPoint tmpPoint = aEvent->widget->WidgetToScreenOffset();
1963-
aEvent->refPoint = mGestureDownPoint - tmpPoint;
1962+
aEvent->refPoint = mGestureDownPoint -
1963+
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
19641964
aEvent->modifiers = mGestureModifiers;
19651965
aEvent->buttons = mGestureDownButtons;
19661966
}
@@ -2016,7 +2016,8 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
20162016
}
20172017

20182018
// fire drag gesture if mouse has moved enough
2019-
nsIntPoint pt = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
2019+
LayoutDeviceIntPoint pt = aEvent->refPoint +
2020+
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
20202021
if (DeprecatedAbs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
20212022
DeprecatedAbs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
20222023
if (mClickHoldContextMenu) {
@@ -3486,9 +3487,9 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
34863487
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
34873488
event.refPoint = mouseEvent->refPoint;
34883489
if (mouseEvent->widget) {
3489-
event.refPoint += mouseEvent->widget->WidgetToScreenOffset();
3490+
event.refPoint += LayoutDeviceIntPoint::FromUntyped(mouseEvent->widget->WidgetToScreenOffset());
34903491
}
3491-
event.refPoint -= widget->WidgetToScreenOffset();
3492+
event.refPoint -= LayoutDeviceIntPoint::FromUntyped(widget->WidgetToScreenOffset());
34923493
event.modifiers = mouseEvent->modifiers;
34933494
event.buttons = mouseEvent->buttons;
34943495
event.inputSource = mouseEvent->inputSource;
@@ -4145,12 +4146,12 @@ nsEventStateManager::NotifyMouseOver(nsGUIEvent* aEvent, nsIContent* aContent)
41454146
// mode (see bug 799523 comment 35, and bug 729011). Using integer CSS pix
41464147
// makes us throw away the fractional error that results, rather than having
41474148
// it manifest as a potential one-device-pix discrepancy.
4148-
static nsIntPoint
4149+
static LayoutDeviceIntPoint
41494150
GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
41504151
nsIWidget* aWidget,
41514152
nsPresContext* aContext)
41524153
{
4153-
NS_ENSURE_TRUE(aWindow && aWidget && aContext, nsIntPoint(0,0));
4154+
NS_ENSURE_TRUE(aWindow && aWidget && aContext, LayoutDeviceIntPoint(0, 0));
41544155

41554156
float cssInnerX = 0.0;
41564157
aWindow->GetMozInnerScreenX(&cssInnerX);
@@ -4172,7 +4173,7 @@ GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
41724173
int32_t cssScreenX = aContext->DevPixelsToIntCSSPixels(screen.x);
41734174
int32_t cssScreenY = aContext->DevPixelsToIntCSSPixels(screen.y);
41744175

4175-
return nsIntPoint(
4176+
return LayoutDeviceIntPoint(
41764177
aContext->CSSPixelsToDevPixels(innerX - cssScreenX + innerWidth / 2),
41774178
aContext->CSSPixelsToDevPixels(innerY - cssScreenY + innerHeight / 2));
41784179
}
@@ -4200,9 +4201,9 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
42004201
// (locked) pointer can continue moving and won't stop at the screen
42014202
// boundary. We cancel the synthetic event so that we don't end up
42024203
// dispatching the centering move event to content.
4203-
nsIntPoint center = GetWindowInnerRectCenter(mDocument->GetWindow(),
4204-
aEvent->widget,
4205-
mPresContext);
4204+
LayoutDeviceIntPoint center =
4205+
GetWindowInnerRectCenter(mDocument->GetWindow(), aEvent->widget,
4206+
mPresContext);
42064207
aEvent->lastRefPoint = center;
42074208
if (aEvent->refPoint != center) {
42084209
// Mouse move doesn't finish at the center of the window. Dispatch a
@@ -4212,7 +4213,7 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
42124213
// in the other branch here.
42134214
sSynthCenteringPoint = center;
42144215
aEvent->widget->SynthesizeNativeMouseMove(
4215-
center + aEvent->widget->WidgetToScreenOffset());
4216+
LayoutDeviceIntPoint::ToUntyped(center) + aEvent->widget->WidgetToScreenOffset());
42164217
} else if (aEvent->refPoint == sSynthCenteringPoint) {
42174218
// This is the "synthetic native" event we dispatched to re-center the
42184219
// pointer. Cancel it so we don't expose the centering move to content.
@@ -4302,7 +4303,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
43024303
aWidget,
43034304
mPresContext);
43044305
aWidget->SynthesizeNativeMouseMove(
4305-
sLastRefPoint + aWidget->WidgetToScreenOffset());
4306+
LayoutDeviceIntPoint::ToUntyped(sLastRefPoint) + aWidget->WidgetToScreenOffset());
43064307

43074308
// Retarget all events to this element via capture.
43084309
nsIPresShell::SetCapturingContent(aElement, CAPTURE_POINTERLOCK);
@@ -4318,7 +4319,7 @@ nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
43184319
// no movement.
43194320
sLastRefPoint = mPreLockPoint;
43204321
aWidget->SynthesizeNativeMouseMove(
4321-
mPreLockPoint + aWidget->WidgetToScreenOffset());
4322+
LayoutDeviceIntPoint::ToUntyped(mPreLockPoint) + aWidget->WidgetToScreenOffset());
43224323

43234324
// Don't retarget events to this element any more.
43244325
nsIPresShell::SetCapturingContent(nullptr, CAPTURE_POINTERLOCK);

0 commit comments

Comments
 (0)