Closed Bug 1157409 Opened 9 years ago Closed 9 years ago

APZ on Windows e10s loses some mouse wheel events with high-precision mouse

Categories

(Core :: Panning and Zooming, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
e10s - ---
firefox40 --- fixed

People

(Reporter: bent.mozilla, Assigned: dvander)

References

Details

Attachments

(1 file, 1 obsolete file)

Something crazy is happening with mousewheel scrolling today, some events are getting lost somehow. Intermittently my mouswheel scrolling doesn't do anything, at least not at first. Changing focus to other windows on my system and then back to firefox seems to make it happen more frequently.
Can you provide a specific page/scrollframe that didn't work?
Also, what make/model mouse do you have?
Flags: needinfo?(bent.mozilla)
It's a Logitech B100. And I see this behavior on bugzilla, gmail, everywhere.
Flags: needinfo?(bent.mozilla)
This is the hi-res mouse David was talking about, I believe.
Assignee: nobody → dvander
This will need to be fixed before we turn it on by default.
Blocks: apz-windows
Summary: APZ on Windows e10s loses some mouse wheel events → APZ on Windows e10s loses some mouse wheel events with high-precision mouse
I got a high resolution mouse and can reproduce this really easily. It's pretty annoying.
Status: NEW → ASSIGNED
Well, I definitely found one problem, a race condition. But I'm not sure if high resolution mice are related. Say the compositor thread (c) and controller thread (I) are separate threads, and we try to composite a frame as we get a new wheel event:

c: Begin a new frame.
c: Cache TimeStamp::Now() as APZ's current frame time.
I: Take the APZC lock to start an animation.
c: Take the APZC lock to update the current animation - BLOCKED.
I: Initialize a new wheel animation with TimeStamp::Now().
I: Release the APZC lock.
c: UNBLOCKED - the cached frame time is now < the animation start time.

This confuses the key spline function and we think the delta is 0, and end the animation prematurely.
Attached patch fix (obsolete) — Splinter Review
The problem is the IsZero(adjustedOffset) check in WheelScrollAnimation::DoSample(). Given that, this seemed like the easiest fix. I changed the animation to use GetFrameTime instead of event.mTimeStamp for good measure.
Attachment #8597746 - Flags: review?(bugmail.mozilla)
Comment on attachment 8597746 [details] [diff] [review]
fix

Review of attachment 8597746 [details] [diff] [review]:
-----------------------------------------------------------------

I'm fine with the WheelScrollAnimation changes, but I'd rather leave the Update call as using the timestamp from the event, unless we actually need it to fix the issue.
Attachment #8597746 - Flags: review?(bugmail.mozilla) → review+
Attached patch fixSplinter Review
The previous patch turned out to not work all the time. Even if we clamp the event time to <= |initial frame time|, the frame time could be so soon after the event that we still request a scroll delta of 0.

This version changes the condition that ends the animation, to exclude frames that result in an unadjusted displacement of 0.
Attachment #8598276 - Flags: review?(bugmail.mozilla)
Attachment #8597746 - Attachment is obsolete: true
Attachment #8598276 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/cb70f0ab7163
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: