Open Bug 1662487 Opened 4 years ago Updated 4 years ago

Make moveMouseAndScrollWheelOver produce the indicated amount of scroll on windows

Categories

(Core :: Panning and Zooming, task)

All
Windows
task

Tracking

()

People

(Reporter: kats, Unassigned)

References

Details

We use the moveMouseAndScrollWheelOver function in some APZ mochitests, and provide it with some deltas for wheel-scrolling. However, on Windows, the amount of delta in the synthesized wheel event is not what we expect.

In particular, it looks like this code uses WHEEL_DELTA as 120, and so for line events nativeDeltaPerUnit is 40. So if we try to synthesize a wheel scroll with 150 pixels, it will only do 3.75 lines worth, and APZ then scales that up by 17 pixels/line to scroll 63.75 pixels.

Here is some logging output from such a test which requests 150 pixels of scrolling. Note the wParam stores 150 (0x96) in the top half, the mDeltaY is -3.75, and the mLineOrPageDeltaY is -3 with the leftover 30 pixels going into the mAccumulatedDelta. And then APZ turns it into 63.75 parent-layer pixels.

[task 2020-09-01T15:33:26.612Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScrollHandler::SynthesizingEvent::Synthesize(): aCursorPoint: { x: 10, y: 84 }, aWnd=0x1803E0, aMessage=0x020A, aWParam=0x00960000, aLParam=0x0054000A, IsSynthesized()=FALSE, mStatus=NOT_SYNTHESIZING
[task 2020-09-01T15:33:26.612Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::ProcessNativeMouseWheelMessage: aWidget=0000024ADB4CE000, aMessage=WM_MOUSEWHEEL, wParam=0x00960000, lParam=0x0054000A, point: { x=10, y=84 }
[task 2020-09-01T15:33:26.614Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::ProcessNativeMouseWheelMessage: Succeeded, Posting internal message to an nsWindow (0000024ADB4CE000)...
[task 2020-09-01T15:33:26.614Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScrollHandler::SynthesizingEvent::NotifyNativeMessageHandlingFinished(): IsWaitingInternalMessage=TRUE
[task 2020-09-01T15:33:26.614Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::HandleMouseWheelMessage: aWidget=0000024ADB4CE000, aMessage=MOZ_WM_MOUSEVWHEEL, aWParam=0x00960000, aLParam=0x0054000A
[task 2020-09-01T15:33:26.615Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::LastEventInfo::ResetTransaction()
[task 2020-09-01T15:33:26.615Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::LastEventInfo::InitWheelEvent: aWidget=0000024ADB4CE000, aWheelEvent { mRefPoint: { x: 10, y: 92 }, mDeltaX: 0.000000, mDeltaY: -3.750000, mLineOrPageDeltaX: 0, mLineOrPageDeltaY: -3, isShift: FALSE, isControl: FALSE, isAlt: FALSE, isMeta: FALSE, mAllowToOverrideSystemScrollSpeed: FALSE }, mAccumulatedDelta: 30
[task 2020-09-01T15:33:26.617Z] 15:33:26     INFO - GECKO(4080) | [Parent 1972: Main Thread]: I/MouseScrollHandlerWidgets MouseScroll::HandleMouseWheelMessage: dispatching eWheel event
...
[task 2020-09-01T15:33:26.624Z] 15:33:26     INFO - GECKO(4080) | [GPU 2848: Main Thread]: D/apz.controller 000002C218178000 got a scroll-wheel with delta in parent-layer pixels: (0,-63.75)
OS: Unspecified → Windows
Hardware: Unspecified → All
You need to log in before you can comment on or make changes to this bug.