Skip to content

applet: fix resetting wheel delta from previous scroll action

There might be a remainder from the previous wheel operation for "fast-scrolling" mice, that report multiple wheel events with deltas smaller than a typical "120" delta event. If the user reverses the wheel direction, we need to reset the existing accumulated wheelDelta, otherwise the latest event may end up being ignored altogether.

Example of problematic wheel events:

  1. event delta: -64
  2. event delta: -24
  3. event delta: -24

The accumulated wheelDelta is now -112, which gets ignored because it doesn't exceed the 120 wheel delta threshold.

  1. event delta: 120

The accumulated wheelDelta is now 8 (-112 from the previous events + 120). Even though we received a delta of 120, the existing remainder means we end up ignoring the wheel event again.

Merge request reports